aboutsummaryrefslogtreecommitdiffstats
path: root/perllib/FixMyStreet/TestMech.pm
diff options
context:
space:
mode:
authorDave Arter <davea@mysociety.org>2016-09-08 09:51:21 +0100
committerDave Arter <davea@mysociety.org>2016-09-08 09:51:21 +0100
commita8a8d0eabe274f1492c3cb66479098056d901924 (patch)
tree6f8b6c618c1cc389e0fdd737b319e0d4ce661cda /perllib/FixMyStreet/TestMech.pm
parent80a01c11f656f19d6df4c2e4294f613db14689b1 (diff)
parentf6c8fa2f1146abaaa9817f9e64cf388fe068eebd (diff)
Merge branch 'issues/forcouncils/31-response-templates'
Diffstat (limited to 'perllib/FixMyStreet/TestMech.pm')
-rw-r--r--perllib/FixMyStreet/TestMech.pm11
1 files changed, 10 insertions, 1 deletions
diff --git a/perllib/FixMyStreet/TestMech.pm b/perllib/FixMyStreet/TestMech.pm
index c3583bb3e..ee9631bdf 100644
--- a/perllib/FixMyStreet/TestMech.pm
+++ b/perllib/FixMyStreet/TestMech.pm
@@ -600,12 +600,21 @@ sub delete_body {
my $body = shift;
$mech->delete_problems_for_body($body->id);
- $body->contacts->delete;
+ $mech->delete_contact($_) for $body->contacts;
$mech->delete_user($_) for $body->users;
+ $_->delete for $body->response_templates;
$body->body_areas->delete;
$body->delete;
}
+sub delete_contact {
+ my $mech = shift;
+ my $contact = shift;
+
+ $contact->contact_response_templates->delete_all;
+ $contact->delete;
+}
+
sub delete_problems_for_body {
my $mech = shift;
my $body = shift;