diff options
| author | Sergey Fedoseev <fedoseev.sergey@gmail.com> | 2015-11-05 10:37:51 +0500 |
|---|---|---|
| committer | Tim Graham <timograham@gmail.com> | 2015-11-18 12:06:03 -0500 |
| commit | 7a452c5ce295679307bd81dd9b5f37b3cf762acf (patch) | |
| tree | 5471571f67f48aadbe31478e1491b13bc8f63fde /tests | |
| parent | 7803f429a4d435623cb7b91dd324d3aadad87380 (diff) | |
Fixed #25665 -- Deprecated getter/setter of Point.tuple.
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/gis_tests/geos_tests/test_geos.py | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/tests/gis_tests/geos_tests/test_geos.py b/tests/gis_tests/geos_tests/test_geos.py index 9b1a7e384f..683d00c89f 100644 --- a/tests/gis_tests/geos_tests/test_geos.py +++ b/tests/gis_tests/geos_tests/test_geos.py @@ -787,7 +787,8 @@ class GEOSTest(unittest.TestCase, TestDataMixin): # Testing a 3D Point pnt = Point(2, 3, 8) self.assertEqual((2., 3., 8.), pnt.coords) - self.assertRaises(TypeError, pnt.set_coords, (1., 2.)) + with self.assertRaises(TypeError): + pnt.tuple = (1., 2.) pnt.coords = (1., 2., 3.) self.assertEqual((1., 2., 3.), pnt.coords) @@ -1156,6 +1157,14 @@ class GEOSTest(unittest.TestCase, TestDataMixin): 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)) + p.set_y(2) + p.set_z(1) + self.assertEqual((p.x, p.y, p.z), (3, 2, 1)) + + @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)) |
