diff options
| author | David Smith <smithdc@gmail.com> | 2024-01-22 17:55:40 +0000 |
|---|---|---|
| committer | Mariusz Felisiak <felisiak.mariusz@gmail.com> | 2024-01-23 05:37:59 +0100 |
| commit | f4c597346453c44769726d2ac061fbc028b2fd5b (patch) | |
| tree | 643d315a856a875df5977b2ec769b7782db58812 /tests | |
| parent | 8570e091d025c4aacc6b76597a3322030c2f8162 (diff) | |
Refs #35058 -- Deprecated OGRGeometry.coord_dim setter.
Reflecting a change in the underlying GDAL library (since GDAL 2.1)
using coord_dim to set a geometries dimensions is deprecated in favor
of set_3d().
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/gis_tests/gdal_tests/test_geom.py | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/tests/gis_tests/gdal_tests/test_geom.py b/tests/gis_tests/gdal_tests/test_geom.py index 9d62bcd07b..13e7d3e70d 100644 --- a/tests/gis_tests/gdal_tests/test_geom.py +++ b/tests/gis_tests/gdal_tests/test_geom.py @@ -11,6 +11,7 @@ from django.contrib.gis.gdal import ( from django.template import Context from django.template.engine import Engine from django.test import SimpleTestCase +from django.utils.deprecation import RemovedInDjango60Warning from ..test_data import TestDataMixin @@ -810,3 +811,12 @@ class OGRGeomTest(SimpleTestCase, TestDataMixin): g = OGRGeometry(geom) self.assertEqual(g.wkt, geom) self.assertEqual(g.wkb.hex(), wkb) + + +class DeprecationTests(SimpleTestCase): + def test_coord_setter_deprecation(self): + geom = OGRGeometry("POINT (1 2)") + msg = "coord_dim setter is deprecated. Use set_3d() instead." + with self.assertWarnsMessage(RemovedInDjango60Warning, msg): + geom.coord_dim = 3 + self.assertEqual(geom.coord_dim, 3) |
