diff options
author | Matthew Somerville <matthew-github@dracos.co.uk> | 2017-06-20 17:42:59 +0100 |
---|---|---|
committer | Matthew Somerville <matthew-github@dracos.co.uk> | 2017-06-20 18:03:27 +0100 |
commit | d6b63a8cd4b00c2f7646031f29c5ea12711fb76e (patch) | |
tree | 470ec47764096b5b5f46524358e261c9db3a08f6 /bin | |
parent | bada68b27226eb2d0f119edf0fed866bd473b032 (diff) |
[fixmystreet.com] Template/priorities in fixture.
Also include areas in auto-generated problems.
Diffstat (limited to 'bin')
-rwxr-xr-x | bin/fixmystreet.com/fixture | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/bin/fixmystreet.com/fixture b/bin/fixmystreet.com/fixture index 9bb9435c5..d3b0a8349 100755 --- a/bin/fixmystreet.com/fixture +++ b/bin/fixmystreet.com/fixture @@ -67,6 +67,14 @@ my $body = FixMyStreet::DB::Factory::Body->find_or_create({ }); say "Created body " . $body->name . " for MapIt area ID " . $opt->area_id . ', categories ' . join(', ', @$categories); +FixMyStreet::DB::Factory::ResponseTemplate->create({ body => $body, title => 'Generic' }); +FixMyStreet::DB::Factory::ResponseTemplate->create({ body => $body, title => 'Fixed', state => 'fixed - council' }); +FixMyStreet::DB::Factory::ResponseTemplate->create({ body => $body, title => 'Monitoring', state => 'unable to fix' }); +my $template = FixMyStreet::DB::Factory::ResponseTemplate->create({ body => $body, title => 'Not us', state => 'not responsible' }); +$template->add_to_contacts($body->contacts->first); +my $priority = FixMyStreet::DB::Factory::ResponsePriority->create_batch(3, { body => $body }); +$priority->[0]->add_to_contacts($body->contacts->first); + # Users say "Created users, all with password 'password':"; my $user; # Will store the final (normal) user of the loop for later user @@ -123,6 +131,7 @@ for (1..$num) { my $titles = $titles{$category}; push @$problems, FixMyStreet::DB::Factory::Problem->create({ body => $body, + areas => ',' . $opt->area_id . ',', user => $user, postcode => $postcode->{postcode}, latitude => $postcode->{wgs84_lat} + rand($inaccurate_km) - $inaccurate_km / 2, |