MCPcopy
hub / github.com/django/django / test_geojson

Method test_geojson

tests/gis_tests/geo3d/tests.py:278–292  ·  view source on GitHub ↗

Test GeoJSON() function with Z values.

(self)

Source from the content-addressed store, hash-verified

276 self.assertTrue(ref_kml_regex.match(h.kml))
277
278 def test_geojson(self):
279 """
280 Test GeoJSON() function with Z values.
281 """
282 self._load_city_data()
283 h = City3D.objects.annotate(geojson=AsGeoJSON("point", precision=6)).get(
284 name="Houston"
285 )
286 # GeoJSON should be 3D
287 # `SELECT ST_AsGeoJSON(point, 6) FROM geo3d_city3d
288 # WHERE name='Houston';`
289 ref_json_regex = re.compile(
290 r'^{"type":"Point","coordinates":\[-95.363151,29.763374,18(\.0+)?\]}$'
291 )
292 self.assertTrue(ref_json_regex.match(h.geojson))
293
294 def test_perimeter(self):
295 """

Callers

nothing calls this directly

Calls 6

AsGeoJSONClass · 0.90
_load_city_dataMethod · 0.80
annotateMethod · 0.80
getMethod · 0.45
compileMethod · 0.45
matchMethod · 0.45

Tested by

no test coverage detected