aboutsummaryrefslogtreecommitdiffstats
path: root/t/app/model
diff options
context:
space:
mode:
Diffstat (limited to 't/app/model')
-rw-r--r--t/app/model/alert_type.t3
-rw-r--r--t/app/model/comment.t9
-rw-r--r--t/app/model/db.t5
-rw-r--r--t/app/model/defecttype.t2
-rw-r--r--t/app/model/extra.t10
-rw-r--r--t/app/model/moderation.t5
-rw-r--r--t/app/model/photoset.t9
-rw-r--r--t/app/model/problem.t6
-rw-r--r--t/app/model/questionnaire.t2
-rw-r--r--t/app/model/rabx_column.t5
-rw-r--r--t/app/model/token.t5
-rw-r--r--t/app/model/user.t1
-rw-r--r--t/app/model/user_planned_report.t5
13 files changed, 9 insertions, 58 deletions
diff --git a/t/app/model/alert_type.t b/t/app/model/alert_type.t
index 2e1298134..eab4ec614 100644
--- a/t/app/model/alert_type.t
+++ b/t/app/model/alert_type.t
@@ -504,8 +504,5 @@ subtest "correct i18n-ed summary for state of closed" => sub {
};
END {
- $mech->delete_user($user) if $user;
- $mech->delete_user($user2) if $user2;
- $mech->delete_user($user3) if $user3;
done_testing();
}
diff --git a/t/app/model/comment.t b/t/app/model/comment.t
index e83d795fc..3f30b3a1e 100644
--- a/t/app/model/comment.t
+++ b/t/app/model/comment.t
@@ -1,10 +1,4 @@
-use strict;
-use warnings;
-
-use Test::More tests => 2;
-
-use FixMyStreet;
-use FixMyStreet::DB;
+use FixMyStreet::Test;
my $comment_rs = FixMyStreet::DB->resultset('Comment');
@@ -23,3 +17,4 @@ my $comment = $comment_rs->new(
is $comment->confirmed, undef, 'inflating null confirmed ok';
is $comment->created, undef, 'inflating null confirmed ok';
+done_testing();
diff --git a/t/app/model/db.t b/t/app/model/db.t
index bebd68f0b..191058bbe 100644
--- a/t/app/model/db.t
+++ b/t/app/model/db.t
@@ -1,7 +1,4 @@
-use strict;
-use warnings;
-
-use Test::More;
+use FixMyStreet::Test;
use_ok 'FixMyStreet::App::Model::DB';
diff --git a/t/app/model/defecttype.t b/t/app/model/defecttype.t
index c3e3035a6..ec79c1c8e 100644
--- a/t/app/model/defecttype.t
+++ b/t/app/model/defecttype.t
@@ -57,7 +57,5 @@ subtest 'Problem->defect_types behaves correctly' => sub {
END {
- $mech->delete_body( $oxfordshire );
-
done_testing();
}
diff --git a/t/app/model/extra.t b/t/app/model/extra.t
index 2d5c3d5e0..c073ae161 100644
--- a/t/app/model/extra.t
+++ b/t/app/model/extra.t
@@ -1,13 +1,8 @@
-use strict;
-use warnings;
-use Test::More;
-use utf8;
+use FixMyStreet::Test;
-use FixMyStreet::DB;
use DateTime;
-my $db = FixMyStreet::DB->connect;
-$db->txn_begin;
+my $db = FixMyStreet::DB->storage->schema;
my $body = $db->resultset('Body')->create({ name => 'ExtraTestingBody' });
@@ -104,5 +99,4 @@ subtest 'Default hash layout' => sub {
};
};
-$db->txn_rollback;
done_testing();
diff --git a/t/app/model/moderation.t b/t/app/model/moderation.t
index 4dbda3f6c..973b9a70a 100644
--- a/t/app/model/moderation.t
+++ b/t/app/model/moderation.t
@@ -1,8 +1,5 @@
-use strict;
-use warnings;
-use Test::More;
+use FixMyStreet::Test;
use Test::Exception;
-use utf8;
use FixMyStreet::DB;
use DateTime;
diff --git a/t/app/model/photoset.t b/t/app/model/photoset.t
index 54530adfb..3651a188a 100644
--- a/t/app/model/photoset.t
+++ b/t/app/model/photoset.t
@@ -1,8 +1,5 @@
-use strict;
-use warnings;
-use Test::More;
+use FixMyStreet::Test;
use Test::Exception;
-use utf8;
use FixMyStreet::DB;
use DateTime;
@@ -23,8 +20,6 @@ FixMyStreet::override_config {
UPLOAD_DIR => $UPLOAD_DIR,
}, sub {
-$db->txn_begin;
-
my $image_path = path('t/app/controller/sample.jpg');
sub make_report {
@@ -74,8 +69,6 @@ subtest 'Photoset with 3 referenced photo' => sub {
is $photoset->num_images, 3, 'Found 3 images';
};
-$db->txn_rollback;
-
};
done_testing();
diff --git a/t/app/model/problem.t b/t/app/model/problem.t
index d95aec98d..142262ae9 100644
--- a/t/app/model/problem.t
+++ b/t/app/model/problem.t
@@ -875,11 +875,5 @@ subtest 'return how many days ago a problem was reported' => sub {
};
END {
- $problem->comments->delete if $problem;
- $problem->delete if $problem;
- $mech->delete_user( $user ) if $user;
-
- $mech->delete_body($_) for @bodies;
-
done_testing();
}
diff --git a/t/app/model/questionnaire.t b/t/app/model/questionnaire.t
index 9685c5345..169895f95 100644
--- a/t/app/model/questionnaire.t
+++ b/t/app/model/questionnaire.t
@@ -108,6 +108,4 @@ for my $test (
}
}
-$mech->delete_user( $user );
-
done_testing();
diff --git a/t/app/model/rabx_column.t b/t/app/model/rabx_column.t
index 607d578ce..9232a92f0 100644
--- a/t/app/model/rabx_column.t
+++ b/t/app/model/rabx_column.t
@@ -1,7 +1,4 @@
-use strict;
-use warnings;
-
-use Test::More;
+use FixMyStreet::Test;
use_ok "FixMyStreet::DB::RABXColumn";
diff --git a/t/app/model/token.t b/t/app/model/token.t
index e31901187..60b170a26 100644
--- a/t/app/model/token.t
+++ b/t/app/model/token.t
@@ -1,7 +1,4 @@
-use strict;
-use warnings;
-
-use Test::More;
+use FixMyStreet::Test;
use FixMyStreet;
use FixMyStreet::DB;
diff --git a/t/app/model/user.t b/t/app/model/user.t
index 76d395fdc..5a9c898a2 100644
--- a/t/app/model/user.t
+++ b/t/app/model/user.t
@@ -64,7 +64,6 @@ FixMyStreet::override_config {
};
END {
- $mech->delete_user( $problem->user ) if $problem;
done_testing();
}
diff --git a/t/app/model/user_planned_report.t b/t/app/model/user_planned_report.t
index 3473e1bbd..f2fe79cc2 100644
--- a/t/app/model/user_planned_report.t
+++ b/t/app/model/user_planned_report.t
@@ -40,8 +40,3 @@ is $user2->active_planned_reports, 0;
is $user2->planned_reports, 1;
done_testing();
-
-END {
- $mech->delete_user($user);
- $mech->delete_user($user2);
-}