Refs #25665 -- Removed deprecated getters/setters of Point coordinate properties.

This commit is contained in:
Tim Graham 2016-12-31 09:36:46 -05:00
parent a0149848f7
commit 19d8e64ac3
3 changed files with 3 additions and 52 deletions

View File

@ -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):

View File

@ -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.

View File

@ -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)