MCPcopy
hub / github.com/django/django / test_kml

Method test_kml

tests/gis_tests/geo3d/tests.py:265–276  ·  view source on GitHub ↗

Test KML() function with Z values.

(self)

Source from the content-addressed store, hash-verified

263@skipUnlessDBFeature("supports_3d_functions")
264class Geo3DFunctionsTests(FuncTestMixin, Geo3DLoadingHelper, TestCase):
265 def test_kml(self):
266 """
267 Test KML() function with Z values.
268 """
269 self._load_city_data()
270 h = City3D.objects.annotate(kml=AsKML("point", precision=6)).get(name="Houston")
271 # KML should be 3D.
272 # `SELECT ST_AsKML(point, 6) FROM geo3d_city3d WHERE name = 'Houston';`
273 ref_kml_regex = re.compile(
274 r"^<Point><coordinates>-95.363\d+,29.763\d+,18</coordinates></Point>$"
275 )
276 self.assertTrue(ref_kml_regex.match(h.kml))
277
278 def test_geojson(self):
279 """

Callers

nothing calls this directly

Calls 6

AsKMLClass · 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