From a0149848f7c068bc8507d3ec6f93cd2b7256098a Mon Sep 17 00:00:00 2001 From: Tim Graham Date: Sat, 31 Dec 2016 09:33:40 -0500 Subject: [PATCH] Refs #25665 -- Removed GEOSGeometry.get/set_srid() per deprecation timeline. --- django/contrib/gis/geos/geometry.py | 16 ---------------- docs/releases/2.0.txt | 3 +++ tests/gis_tests/geos_tests/test_geos.py | 8 -------- 3 files changed, 3 insertions(+), 24 deletions(-) diff --git a/django/contrib/gis/geos/geometry.py b/django/contrib/gis/geos/geometry.py index ffbbc0c859..cf5886dc07 100644 --- a/django/contrib/gis/geos/geometry.py +++ b/django/contrib/gis/geos/geometry.py @@ -5,7 +5,6 @@ from __future__ import unicode_literals import json -import warnings from ctypes import addressof, byref, c_double from django.contrib.gis import gdal @@ -22,7 +21,6 @@ from django.contrib.gis.geos.prototypes.io import ( ) from django.utils import six from django.utils.deconstruct import deconstructible -from django.utils.deprecation import RemovedInDjango20Warning from django.utils.encoding import force_bytes, force_text @@ -385,20 +383,6 @@ class GEOSGeometry(GEOSBase, ListMixin): "Sets the SRID for the geometry." capi.geos_set_srid(self.ptr, 0 if srid is None else srid) - def get_srid(self): - warnings.warn( - "`get_srid()` is deprecated, use the `srid` property instead.", - RemovedInDjango20Warning, 2 - ) - return self.srid - - def set_srid(self, srid): - warnings.warn( - "`set_srid()` is deprecated, use the `srid` property instead.", - RemovedInDjango20Warning, 2 - ) - self.srid = srid - # #### Output Routines #### @property def ewkt(self): diff --git a/docs/releases/2.0.txt b/docs/releases/2.0.txt index 1d46067405..c4e3a90d84 100644 --- a/docs/releases/2.0.txt +++ b/docs/releases/2.0.txt @@ -324,3 +324,6 @@ these features. * Support for direct assignment to a reverse foreign key or many-to-many relation is removed. + +* The ``get_srid()`` and ``set_srid()`` methods of + ``django.contrib.gis.geos.GEOSGeometry`` are removed. diff --git a/tests/gis_tests/geos_tests/test_geos.py b/tests/gis_tests/geos_tests/test_geos.py index 2aee39072d..92f89ce88f 100644 --- a/tests/gis_tests/geos_tests/test_geos.py +++ b/tests/gis_tests/geos_tests/test_geos.py @@ -1316,14 +1316,6 @@ class GEOSTest(SimpleTestCase, TestDataMixin): p.transform(2774) self.assertEqual(p, Point(srid=2774)) - @ignore_warnings(category=RemovedInDjango20Warning) - def test_deprecated_srid_getters_setters(self): - p = Point(1, 2, srid=123) - self.assertEqual(p.get_srid(), p.srid) - - p.set_srid(321) - self.assertEqual(p.srid, 321) - @ignore_warnings(category=RemovedInDjango20Warning) def test_deprecated_point_coordinate_getters_setters(self): p = Point(1, 2, 3)