|
@@ -32,24 +32,27 @@ class GISFunctionsTests(FuncTestMixin, TestCase):
|
|
|
return
|
|
|
|
|
|
pueblo_json = '{"type":"Point","coordinates":[-104.609252,38.255001]}'
|
|
|
- houston_json = (
|
|
|
+ houston_json = json.loads(
|
|
|
'{"type":"Point","crs":{"type":"name","properties":'
|
|
|
'{"name":"EPSG:4326"}},"coordinates":[-95.363151,29.763374]}'
|
|
|
)
|
|
|
- victoria_json = (
|
|
|
+ victoria_json = json.loads(
|
|
|
'{"type":"Point","bbox":[-123.30519600,48.46261100,-123.30519600,48.46261100],'
|
|
|
'"coordinates":[-123.305196,48.462611]}'
|
|
|
)
|
|
|
- chicago_json = (
|
|
|
+ chicago_json = json.loads(
|
|
|
'{"type":"Point","crs":{"type":"name","properties":{"name":"EPSG:4326"}},'
|
|
|
'"bbox":[-87.65018,41.85039,-87.65018,41.85039],"coordinates":[-87.65018,41.85039]}'
|
|
|
)
|
|
|
-
|
|
|
- if mysql:
|
|
|
- houston_json = json.loads(houston_json)
|
|
|
+
|
|
|
+ if mysql or oracle:
|
|
|
del houston_json['crs']
|
|
|
- chicago_json = json.loads(chicago_json)
|
|
|
del chicago_json['crs']
|
|
|
+
|
|
|
+ if oracle:
|
|
|
+ del chicago_json['bbox']
|
|
|
+ del victoria_json['bbox']
|
|
|
+ chicago_json['coordinates'] = [-87.650175, 41.850385]
|
|
|
|
|
|
|
|
|
with self.assertRaises(TypeError):
|
|
@@ -75,10 +78,10 @@ class GISFunctionsTests(FuncTestMixin, TestCase):
|
|
|
|
|
|
|
|
|
self.assertJSONEqual(
|
|
|
- victoria_json,
|
|
|
City.objects.annotate(
|
|
|
geojson=functions.AsGeoJSON('point', bbox=True)
|
|
|
- ).get(name='Victoria').geojson
|
|
|
+ ).get(name='Victoria').geojson,
|
|
|
+ victoria_json,
|
|
|
)
|
|
|
|
|
|
|