diff options
author | Dave Arter <davea@mysociety.org> | 2016-08-23 17:28:11 +0100 |
---|---|---|
committer | Dave Arter <davea@mysociety.org> | 2016-09-08 09:45:58 +0100 |
commit | 1444841970096122c9aeb5e86c82bede01b1bee6 (patch) | |
tree | 79b96fda21ce35037d05065644a1043077bf1717 /perllib/FixMyStreet/TestMech.pm | |
parent | 80a01c11f656f19d6df4c2e4294f613db14689b1 (diff) |
Extend response templates to work across all cobrands
This builds on the response templates in the Zürich cobrand:
- Allow response templates to be assigned to categories
- Also adds a auto_response flag, which will be used to automatically create
updates when reports are made.
- Include response templates select box on update form
For mysociety/fixmystreetforcouncils#31
Diffstat (limited to 'perllib/FixMyStreet/TestMech.pm')
-rw-r--r-- | perllib/FixMyStreet/TestMech.pm | 11 |
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; |