diff options
author | Struan Donald <struan@exo.org.uk> | 2019-05-13 16:27:33 +0100 |
---|---|---|
committer | Struan Donald <struan@exo.org.uk> | 2019-05-28 11:34:19 +0100 |
commit | 2c224616a7ae8e099825005bdcede4774bd1bd9b (patch) | |
tree | b42b0a25cdb6a4852571e0c8b7dbe041d074eb71 | |
parent | 8b232eabd9ccd78d665457c309386519874b8e81 (diff) |
generate test specific fixture data
-rwxr-xr-x | bin/browser-tests | 2 | ||||
-rwxr-xr-x | bin/fixmystreet.com/fixture | 10 |
2 files changed, 11 insertions, 1 deletions
diff --git a/bin/browser-tests b/bin/browser-tests index a3548e50b..20f2f761d 100755 --- a/bin/browser-tests +++ b/bin/browser-tests @@ -79,7 +79,7 @@ sub run { # Set up, and load in some data system('bin/make_css', 'fixmystreet.com'); - system('bin/fixmystreet.com/fixture', '--nonrandom', '--coords', $coords, '--name', $name, '--area-id', $area_id, '--commit'); + system('bin/fixmystreet.com/fixture', '--test_fixtures', '--nonrandom', '--coords', $coords, '--name', $name, '--area-id', $area_id, '--commit'); } my $pid; diff --git a/bin/fixmystreet.com/fixture b/bin/fixmystreet.com/fixture index c75cb53bf..4a5bd3aed 100755 --- a/bin/fixmystreet.com/fixture +++ b/bin/fixmystreet.com/fixture @@ -31,6 +31,7 @@ my ($opt, $usage) = describe_options( [ 'empty', "Empty all tables of the database first" ], [ 'commit', "Actually commit changes to the database" ], [ 'nonrandom', "Output things in a fixed manner, for testing" ], + [ 'test_fixtures', "Generate test specific fixtures" ], [ 'coords=s', "Co-ordinates to use instead of example postcode" ], [ 'help', "print usage message and exit", { shortcircuit => 1 } ], ); @@ -90,6 +91,15 @@ for my $cat ('Dropped Kerbs', 'Skips') { $child_cat->update; } +if ($opt->test_fixtures) { + my $ncc = FixMyStreet::DB::Factory::Body->find_or_create({ + area_id => 2234, + categories => [ 'Fallen Tree' ], + name => 'Northamptonshire County Council', + }); + say "Created body " . $ncc->name . " for MapIt area ID 2234, categories Fallen Tree"; +} + FixMyStreet::DB::Factory::ResponseTemplate->create({ body => $body, title => 'Generic', text => 'Thank you for your report, we will be in touch with an update soon.' }); |