Refs #25665 -- Removed deprecated getter/setter of Point.tuple.

This commit is contained in:
Tim Graham 2016-12-31 09:42:27 -05:00
parent 19d8e64ac3
commit 997c9f7099
3 changed files with 3 additions and 24 deletions

View File

@ -1,4 +1,3 @@
import warnings
from ctypes import c_uint from ctypes import c_uint
from django.contrib.gis import gdal from django.contrib.gis import gdal
@ -6,7 +5,6 @@ from django.contrib.gis.geos import prototypes as capi
from django.contrib.gis.geos.error import GEOSException from django.contrib.gis.geos.error import GEOSException
from django.contrib.gis.geos.geometry import GEOSGeometry from django.contrib.gis.geos.geometry import GEOSGeometry
from django.utils import six from django.utils import six
from django.utils.deprecation import RemovedInDjango20Warning
from django.utils.six.moves import range from django.utils.six.moves import range
@ -151,19 +149,5 @@ class Point(GEOSGeometry):
"Sets the coordinates of the point with the given tuple." "Sets the coordinates of the point with the given tuple."
self._cs[0] = tup self._cs[0] = tup
def get_coords(self):
warnings.warn(
"`get_coords()` is deprecated, use the `tuple` property instead.",
RemovedInDjango20Warning, 2
)
return self.tuple
def set_coords(self, tup):
warnings.warn(
"`set_coords()` is deprecated, use the `tuple` property instead.",
RemovedInDjango20Warning, 2
)
self.tuple = tup
# The tuple and coords properties # The tuple and coords properties
coords = tuple coords = tuple

View File

@ -330,3 +330,6 @@ these features.
* The ``get_x()``, ``set_x()``, ``get_y()``, ``set_y()``, ``get_z()``, and * The ``get_x()``, ``set_x()``, ``get_y()``, ``set_y()``, ``get_z()``, and
``set_z()`` methods of ``django.contrib.gis.geos.Point`` are removed. ``set_z()`` methods of ``django.contrib.gis.geos.Point`` are removed.
* The ``get_coords()`` and ``set_coords()`` methods of
``django.contrib.gis.geos.Point`` are removed.

View File

@ -1316,14 +1316,6 @@ class GEOSTest(SimpleTestCase, TestDataMixin):
p.transform(2774) p.transform(2774)
self.assertEqual(p, Point(srid=2774)) self.assertEqual(p, Point(srid=2774))
@ignore_warnings(category=RemovedInDjango20Warning)
def test_deprecated_point_tuple_getters_setters(self):
p = Point(1, 2, 3)
self.assertEqual(p.get_coords(), (p.x, p.y, p.z))
p.set_coords((3, 2, 1))
self.assertEqual(p.get_coords(), (3, 2, 1))
@ignore_warnings(category=RemovedInDjango20Warning) @ignore_warnings(category=RemovedInDjango20Warning)
def test_deprecated_cascaded_union(self): def test_deprecated_cascaded_union(self):
for geom in self.geometries.multipolygons: for geom in self.geometries.multipolygons: