summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorSergey Fedoseev <fedoseev.sergey@gmail.com>2015-11-05 08:45:42 +0500
committerTim Graham <timograham@gmail.com>2015-11-18 11:57:26 -0500
commit7803f429a4d435623cb7b91dd324d3aadad87380 (patch)
treec086fb15a4b9d873dde92598823055057f4e46ba /tests
parentb7177cc2a422a0183c8f2d56eceb6b9323c6f959 (diff)
Refs #25665 -- Deprecated getters/setters of Point coordinate properties.
Diffstat (limited to 'tests')
-rw-r--r--tests/gis_tests/geos_tests/test_geos.py13
1 files changed, 12 insertions, 1 deletions
diff --git a/tests/gis_tests/geos_tests/test_geos.py b/tests/gis_tests/geos_tests/test_geos.py
index 504676d4c6..9b1a7e384f 100644
--- a/tests/gis_tests/geos_tests/test_geos.py
+++ b/tests/gis_tests/geos_tests/test_geos.py
@@ -862,7 +862,8 @@ class GEOSTest(unittest.TestCase, TestDataMixin):
# Testing __getitem__ (doesn't work on Point or Polygon)
if isinstance(g, Point):
- self.assertRaises(IndexError, g.get_x)
+ with self.assertRaises(IndexError):
+ g.x
elif isinstance(g, Polygon):
lr = g.shell
self.assertEqual('LINEARRING EMPTY', lr.wkt)
@@ -1148,3 +1149,13 @@ class GEOSTest(unittest.TestCase, TestDataMixin):
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)
+ self.assertEqual((p.get_x(), p.get_y(), p.get_z()), (p.x, p.y, p.z))
+
+ p.set_x(3)
+ p.set_y(1)
+ p.set_z(2)
+ self.assertEqual((p.x, p.y, p.z), (3, 1, 2))