'Testing the Extent3D aggregate for 3D models.'

@skipUnlessDBFeature('supports_3d_functions')
def test_extent(self):

    self._load_city_data()
    ref_extent3d = ((-123.305196), (-41.315268), 14, 174.783117, 48.462611, 1433)
    extent = City3D.objects.aggregate(Extent3D('point'))['point__extent3d']
    def check_extent3d(extent3d, tol=6):
        for (ref_val, ext_val) in zip(ref_extent3d, extent3d):
            self.assertAlmostEqual(ref_val, ext_val, tol)
    check_extent3d(extent)
    self.assertIsNone(City3D.objects.none().aggregate(Extent3D('point'))['point__extent3d'])
