diff options
| author | Sergey Fedoseev <fedoseev.sergey@gmail.com> | 2015-11-05 08:45:42 +0500 |
|---|---|---|
| committer | Tim Graham <timograham@gmail.com> | 2015-11-18 11:57:26 -0500 |
| commit | 7803f429a4d435623cb7b91dd324d3aadad87380 (patch) | |
| tree | c086fb15a4b9d873dde92598823055057f4e46ba /tests | |
| parent | b7177cc2a422a0183c8f2d56eceb6b9323c6f959 (diff) | |
Refs #25665 -- Deprecated getters/setters of Point coordinate properties.
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/gis_tests/geos_tests/test_geos.py | 13 |
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)) |
