From 19d8e64ac357271e708f6db377975ee85b7e4342 Mon Sep 17 00:00:00 2001 From: Tim Graham Date: Sat, 31 Dec 2016 09:36:46 -0500 Subject: [PATCH] Refs #25665 -- Removed deprecated getters/setters of Point coordinate properties. --- django/contrib/gis/geos/point.py | 42 ------------------------- docs/releases/2.0.txt | 3 ++ tests/gis_tests/geos_tests/test_geos.py | 10 ------ 3 files changed, 3 insertions(+), 52 deletions(-) diff --git a/django/contrib/gis/geos/point.py b/django/contrib/gis/geos/point.py index c7b91f9bb5..de21e01644 100644 --- a/django/contrib/gis/geos/point.py +++ b/django/contrib/gis/geos/point.py @@ -140,48 +140,6 @@ class Point(GEOSGeometry): raise GEOSException('Cannot set Z on 2D Point.') self._cs.setOrdinate(2, 0, value) - def get_x(self): - warnings.warn( - "`get_x()` is deprecated, use the `x` property instead.", - RemovedInDjango20Warning, 2 - ) - return self.x - - def set_x(self, value): - warnings.warn( - "`set_x()` is deprecated, use the `x` property instead.", - RemovedInDjango20Warning, 2 - ) - self.x = value - - def get_y(self): - warnings.warn( - "`get_y()` is deprecated, use the `y` property instead.", - RemovedInDjango20Warning, 2 - ) - return self.y - - def set_y(self, value): - warnings.warn( - "`set_y()` is deprecated, use the `y` property instead.", - RemovedInDjango20Warning, 2 - ) - self.y = value - - def get_z(self): - warnings.warn( - "`get_z()` is deprecated, use the `z` property instead.", - RemovedInDjango20Warning, 2 - ) - return self.z - - def set_z(self, value): - warnings.warn( - "`set_z()` is deprecated, use the `z` property instead.", - RemovedInDjango20Warning, 2 - ) - self.z = value - # ### Tuple setting and retrieval routines. ### @property def tuple(self): diff --git a/docs/releases/2.0.txt b/docs/releases/2.0.txt index c4e3a90d84..59a6e1f805 100644 --- a/docs/releases/2.0.txt +++ b/docs/releases/2.0.txt @@ -327,3 +327,6 @@ these features. * The ``get_srid()`` and ``set_srid()`` methods of ``django.contrib.gis.geos.GEOSGeometry`` are removed. + +* The ``get_x()``, ``set_x()``, ``get_y()``, ``set_y()``, ``get_z()``, and + ``set_z()`` methods of ``django.contrib.gis.geos.Point`` are removed. diff --git a/tests/gis_tests/geos_tests/test_geos.py b/tests/gis_tests/geos_tests/test_geos.py index 92f89ce88f..6a689188d2 100644 --- a/tests/gis_tests/geos_tests/test_geos.py +++ b/tests/gis_tests/geos_tests/test_geos.py @@ -1316,16 +1316,6 @@ class GEOSTest(SimpleTestCase, TestDataMixin): p.transform(2774) self.assertEqual(p, Point(srid=2774)) - @ignore_warnings(category=RemovedInDjango20Warning) - def test_deprecated_point_coordinate_getters_setters(self): - p = Point(1, 2, 3) - self.assertEqual((p.get_x(), p.get_y(), p.get_z()), (p.x, p.y, p.z)) - - p.set_x(3) - p.set_y(2) - p.set_z(1) - self.assertEqual((p.x, p.y, p.z), (3, 2, 1)) - @ignore_warnings(category=RemovedInDjango20Warning) def test_deprecated_point_tuple_getters_setters(self): p = Point(1, 2, 3)