aboutsummaryrefslogtreecommitdiffstats
path: root/bin
diff options
context:
space:
mode:
authorEdmund von der Burg <evdb@mysociety.org>2011-02-09 16:25:40 +0000
committerEdmund von der Burg <evdb@mysociety.org>2011-02-09 16:25:40 +0000
commit939f41a4c726f35eed89e6aabc7b76f36521e096 (patch)
treec50645d2c6d6f52b746010b3077a29b4e542be00 /bin
parenta37cddebe040db8da5f169dd78d3b08bcdace236 (diff)
convert e,n to lat,lon in submit report to avoid touching the rest of code
Diffstat (limited to 'bin')
-rwxr-xr-xbin/test-run10
1 files changed, 8 insertions, 2 deletions
diff --git a/bin/test-run b/bin/test-run
index 15f9c3ed2..4f45da3fc 100755
--- a/bin/test-run
+++ b/bin/test-run
@@ -27,6 +27,7 @@ use FindBin;
use mySociety::Config;
mySociety::Config::set_file('../conf/general');
use mySociety::DBHandle qw(dbh);
+use mySociety::GeoUtil;
use mySociety::WebTestHarness;
use Test::Harness;
use File::Find;
@@ -213,6 +214,11 @@ sub submit_postcode{
sub submit_report {
my ($postcode, $x, $y, $easting, $northing, $user_num, $council, $texts, $cobrand ) = @_;
my @messages = @{$texts};
+
+ # convert easting, northing to lat lon
+ my ( $latitude, $longitude ) =
+ mySociety::GeoUtil::national_grid_to_wsg84( $easting, $northing, 'G' );
+
submit_postcode($cobrand, $postcode, $messages[0]);
{
# Writing values to hidden fields, so switching
@@ -235,8 +241,8 @@ sub submit_report {
y => $y,
pc => $postcode,
council => -1,
- easting => $easting,
- northing => $northing,
+ latitude => $latitude,
+ longitude => $longitude,
title => 'My test problem',
detail => 'Detail of my test problem',
anonymous => 1,