diff options
| author | Sergey Fedoseev <fedoseev.sergey@gmail.com> | 2016-12-17 19:23:47 +0600 |
|---|---|---|
| committer | Tim Graham <timograham@gmail.com> | 2016-12-17 08:23:47 -0500 |
| commit | 17a9e0cd07a888bf87370455183d2528bf03470c (patch) | |
| tree | f4317615b7e6759894a84da5eeb3f9458f8b1fb7 /tests | |
| parent | 5d28fef8f9329e440ee67cefc900dbf89f4c524c (diff) | |
Used assertJSONEqual() in GISFunctionsTests.test_asgeojson().
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/gis_tests/geoapp/test_functions.py | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/tests/gis_tests/geoapp/test_functions.py b/tests/gis_tests/geoapp/test_functions.py index bbf1fd1144..bd72a365e2 100644 --- a/tests/gis_tests/geoapp/test_functions.py +++ b/tests/gis_tests/geoapp/test_functions.py @@ -46,11 +46,6 @@ class GISFunctionsTests(TestCase): '{"type":"Point","crs":{"type":"name","properties":{"name":"EPSG:4326"}},' '"bbox":[-87.65018,41.85039,-87.65018,41.85039],"coordinates":[-87.65018,41.85039]}' ) - if spatialite: - victoria_json = ( - '{"type":"Point","bbox":[-123.305196,48.462611,-123.305196,48.462611],' - '"coordinates":[-123.305196,48.462611]}' - ) # Precision argument should only be an integer with self.assertRaises(TypeError): @@ -59,7 +54,7 @@ class GISFunctionsTests(TestCase): # Reference queries and values. # SELECT ST_AsGeoJson("geoapp_city"."point", 8, 0) # FROM "geoapp_city" WHERE "geoapp_city"."name" = 'Pueblo'; - self.assertEqual( + self.assertJSONEqual( pueblo_json, City.objects.annotate(geojson=functions.AsGeoJSON('point')).get(name='Pueblo').geojson ) @@ -67,7 +62,7 @@ class GISFunctionsTests(TestCase): # SELECT ST_AsGeoJson("geoapp_city"."point", 8, 2) FROM "geoapp_city" # WHERE "geoapp_city"."name" = 'Houston'; # This time we want to include the CRS by using the `crs` keyword. - self.assertEqual( + self.assertJSONEqual( houston_json, City.objects.annotate(json=functions.AsGeoJSON('point', crs=True)).get(name='Houston').json ) @@ -75,7 +70,7 @@ class GISFunctionsTests(TestCase): # SELECT ST_AsGeoJson("geoapp_city"."point", 8, 1) FROM "geoapp_city" # WHERE "geoapp_city"."name" = 'Houston'; # This time we include the bounding box by using the `bbox` keyword. - self.assertEqual( + self.assertJSONEqual( victoria_json, City.objects.annotate( geojson=functions.AsGeoJSON('point', bbox=True) @@ -85,7 +80,7 @@ class GISFunctionsTests(TestCase): # SELECT ST_AsGeoJson("geoapp_city"."point", 5, 3) FROM "geoapp_city" # WHERE "geoapp_city"."name" = 'Chicago'; # Finally, we set every available keyword. - self.assertEqual( + self.assertJSONEqual( chicago_json, City.objects.annotate( geojson=functions.AsGeoJSON('point', bbox=True, crs=True, precision=5) |
