diff options
| author | Sergey Fedoseev <fedoseev.sergey@gmail.com> | 2015-11-04 23:56:14 +0500 |
|---|---|---|
| committer | Tim Graham <timograham@gmail.com> | 2015-11-18 11:49:48 -0500 |
| commit | b7177cc2a422a0183c8f2d56eceb6b9323c6f959 (patch) | |
| tree | c7ad8820b2429336b798a3aeb229960fb5943084 /tests | |
| parent | 5f7f3b46853c958789361a7defda8ca3c3c2be53 (diff) | |
Refs #25665 -- Deprecated getter/setter of GEOSGeometry.srid.
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/gis_tests/geos_tests/test_geos.py | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/tests/gis_tests/geos_tests/test_geos.py b/tests/gis_tests/geos_tests/test_geos.py index b0f3a80ac4..504676d4c6 100644 --- a/tests/gis_tests/geos_tests/test_geos.py +++ b/tests/gis_tests/geos_tests/test_geos.py @@ -19,8 +19,9 @@ from django.contrib.gis.geos.base import GEOSBase from django.contrib.gis.shortcuts import numpy from django.template import Context from django.template.engine import Engine -from django.test import mock +from django.test import ignore_warnings, mock from django.utils import six +from django.utils.deprecation import RemovedInDjango20Warning from django.utils.encoding import force_bytes from django.utils.six.moves import range @@ -629,7 +630,8 @@ class GEOSTest(unittest.TestCase, TestDataMixin): self.assertEqual(4326, pnt.srid) pnt.srid = 3084 self.assertEqual(3084, pnt.srid) - self.assertRaises(ctypes.ArgumentError, pnt.set_srid, '4326') + with self.assertRaises(ctypes.ArgumentError): + pnt.srid = '4326' # Testing SRID keyword on fromstr(), and on Polygon rings. poly = fromstr(self.geometries.polygons[1].wkt, srid=4269) @@ -1138,3 +1140,11 @@ class GEOSTest(unittest.TestCase, TestDataMixin): self.assertTrue(m, msg="Unable to parse the version string '%s'" % v_init) self.assertEqual(m.group('version'), v_geos) self.assertEqual(m.group('capi_version'), v_capi) + + @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) |
