aboutsummaryrefslogtreecommitdiffstats
path: root/perllib/FixMyStreet/Gaze.pm
diff options
context:
space:
mode:
authorDave Arter <davea@mysociety.org>2016-07-08 14:03:20 +0100
committerDave Arter <davea@mysociety.org>2016-07-08 14:03:20 +0100
commit5cc37b53df6eef31e94dfe5e434ae149068bc892 (patch)
tree1abd5023801af2a0eb8c09c7193aba4a88eca3c5 /perllib/FixMyStreet/Gaze.pm
parent2df9363f794679bee9c6d705cd7fc6fdae599718 (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.pm3
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);