MCPcopy
hub / github.com/django/django / test_extent

Method test_extent

tests/gis_tests/geo3d/tests.py:234–250  ·  view source on GitHub ↗

Testing the Extent3D aggregate for 3D models.

(self)

Source from the content-addressed store, hash-verified

232
233 @skipUnlessDBFeature("supports_3d_functions")
234 def test_extent(self):
235 """
236 Testing the Extent3D aggregate for 3D models.
237 """
238 self._load_city_data()
239 # `SELECT ST_Extent3D(point) FROM geo3d_city3d;`
240 ref_extent3d = (-123.305196, -41.315268, 14, 174.783117, 48.462611, 1433)
241 extent = City3D.objects.aggregate(Extent3D("point"))["point__extent3d"]
242
243 def check_extent3d(extent3d, tol=6):
244 for ref_val, ext_val in zip(ref_extent3d, extent3d):
245 self.assertAlmostEqual(ref_val, ext_val, tol)
246
247 check_extent3d(extent)
248 self.assertIsNone(
249 City3D.objects.none().aggregate(Extent3D("point"))["point__extent3d"]
250 )
251
252 @skipUnlessDBFeature("supports_3d_functions")
253 def test_extent3d_filter(self):

Callers

nothing calls this directly

Calls 4

Extent3DClass · 0.90
_load_city_dataMethod · 0.80
aggregateMethod · 0.80
noneMethod · 0.80

Tested by

no test coverage detected