From f4c597346453c44769726d2ac061fbc028b2fd5b Mon Sep 17 00:00:00 2001 From: David Smith Date: Mon, 22 Jan 2024 17:55:40 +0000 Subject: 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(). --- tests/gis_tests/gdal_tests/test_geom.py | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'tests') 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) -- cgit v1.3