Test KML() function with Z values.
(self)
| 263 | @skipUnlessDBFeature("supports_3d_functions") |
| 264 | class 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 | """ |