diff options
| author | Claude Paroz <claude@2xlibre.net> | 2016-06-18 17:10:16 +0200 |
|---|---|---|
| committer | Claude Paroz <claude@2xlibre.net> | 2016-06-18 21:48:32 +0200 |
| commit | 8ba44ecda024050c219e7cbc1f16c2d56fa258ac (patch) | |
| tree | 62dbb5464fe2ac9404ba24484ad01e94f689530b /tests | |
| parent | b45852c2631d4f291fb22ef3348065f2a3c2e5e3 (diff) | |
Fixed #26775 -- Supported dim=3 geography fields
Thanks François-Xavier Thomas for the report.
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/gis_tests/geo3d/models.py | 1 | ||||
| -rw-r--r-- | tests/gis_tests/geo3d/tests.py | 10 |
2 files changed, 8 insertions, 3 deletions
diff --git a/tests/gis_tests/geo3d/models.py b/tests/gis_tests/geo3d/models.py index e816cb3dad..bcb9e2dc57 100644 --- a/tests/gis_tests/geo3d/models.py +++ b/tests/gis_tests/geo3d/models.py @@ -19,6 +19,7 @@ class NamedModel(models.Model): class City3D(NamedModel): point = models.PointField(dim=3) + pointg = models.PointField(dim=3, geography=True) class Interstate2D(NamedModel): diff --git a/tests/gis_tests/geo3d/tests.py b/tests/gis_tests/geo3d/tests.py index 34ed371d48..f180387aac 100644 --- a/tests/gis_tests/geo3d/tests.py +++ b/tests/gis_tests/geo3d/tests.py @@ -85,7 +85,9 @@ class Geo3DLoadingHelper(object): def _load_city_data(self): for name, pnt_data in city_data: - City3D.objects.create(name=name, point=Point(*pnt_data, srid=4326)) + City3D.objects.create( + name=name, point=Point(*pnt_data, srid=4326), pointg=Point(*pnt_data, srid=4326), + ) def _load_polygon_data(self): bbox_wkt, bbox_z = bbox_data @@ -122,9 +124,11 @@ class Geo3DTest(Geo3DLoadingHelper, TestCase): self._load_city_data() for name, pnt_data in city_data: city = City3D.objects.get(name=name) - z = pnt_data[2] + # Testing both geometry and geography fields self.assertTrue(city.point.hasz) - self.assertEqual(z, city.point.z) + self.assertTrue(city.pointg.hasz) + self.assertEqual(city.point.z, pnt_data[2]) + self.assertEqual(city.pointg.z, pnt_data[2]) def test_3d_polygons(self): """ |
