diff options
author | Dave Arter <davea@mysociety.org> | 2016-07-08 14:03:20 +0100 |
---|---|---|
committer | Dave Arter <davea@mysociety.org> | 2016-07-08 14:03:20 +0100 |
commit | 5cc37b53df6eef31e94dfe5e434ae149068bc892 (patch) | |
tree | 1abd5023801af2a0eb8c09c7193aba4a88eca3c5 /perllib/FixMyStreet/Gaze.pm | |
parent | 2df9363f794679bee9c6d705cd7fc6fdae599718 (diff) |
Stub out calls to Gaze when running tests
The tests were running slowly because of gaze.mysociety.org's rate-limiting.
Diffstat (limited to 'perllib/FixMyStreet/Gaze.pm')
-rw-r--r-- | perllib/FixMyStreet/Gaze.pm | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/perllib/FixMyStreet/Gaze.pm b/perllib/FixMyStreet/Gaze.pm index a072cd246..bccc81d8c 100644 --- a/perllib/FixMyStreet/Gaze.pm +++ b/perllib/FixMyStreet/Gaze.pm @@ -8,6 +8,9 @@ use mySociety::Gaze; sub get_radius_containing_population ($$) { my ($lat, $lon) = @_; + # Don't call out to a real gaze when testing. + return 10.0 if FixMyStreet->test_mode; + my $dist = eval { mySociety::Locale::in_gb_locale { mySociety::Gaze::get_radius_containing_population($lat, $lon, 200_000); |