8 # Here, we're going to shoot messages through a set of things that can
11 # First, we're going to send mesages to receive.
12 # To do so, we'll first send a message to submit,
13 # then send messages to the newly created bugnumber.
16 use File::Temp qw(tempdir);
18 use Debbugs::MIME qw(create_mime_message);
19 use File::Basename qw(dirname basename);
20 use Test::WWW::Mechanize;
21 use HTTP::Status qw(RC_NOT_MODIFIED);
22 # The test functions are placed here to make things easier
24 use DebbugsTest qw(:all);
26 # This must happen before anything is used, otherwise Debbugs::Config will be
27 # set to wrong values.
28 my %config = create_debbugs_configuration();
31 use_ok('Debbugs::Bug');
33 use_ok('Debbugs::Collection::Bug');
38 submit_bug(subject => 'Submitting a bug '.$_,
39 pseudoheaders => {Severity => 'normal',
40 Tags => 'wontfix moreinfo',
46 my $bc = Debbugs::Collection::Bug->new(bugs => [1..4]);
49 ok($bug = $bc->get(1),
50 "Created a bug correctly"
54 ok(!$bug->archiveable,
55 "Newly created bugs are not archiveable"
59 is($bug->submitter,'foo@bugs.something',
64 ok($bug->tags->tag_is_set('wontfix'),
69 is($bug->tags->as_string(),
75 ### run some tests with the database creation
77 ## create the database
78 my $pgsql = create_postgresql_database();
79 update_postgresql_database($pgsql);
81 use_ok('Debbugs::DB');
84 ok($s = Debbugs::DB->connect($pgsql->dsn),
85 "Able to connect to database");
88 $bc = Debbugs::Collection::Bug->new(bugs => [1..4],
90 ok($bug = $bc->get(1),
91 "Created a bug correctly with DB"