diff options
| author | Claude Paroz <claude@2xlibre.net> | 2024-03-10 20:12:30 +0100 |
|---|---|---|
| committer | Mariusz Felisiak <felisiak.mariusz@gmail.com> | 2024-03-18 09:45:33 +0100 |
| commit | 10b31eea337261ba724a71839ebc4bd4ddac3675 (patch) | |
| tree | 11cb8a3abc36bc1f685b4b946c838d1ec90a1de2 /tests | |
| parent | 7646b9023da7e1f6f3a871959db027b3ea36eebb (diff) | |
Refs #31014 -- Added srid argument to FromWKB/FromWKT() GIS functions.
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/gis_tests/geoapp/test_functions.py | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/tests/gis_tests/geoapp/test_functions.py b/tests/gis_tests/geoapp/test_functions.py index 0be690347e..80b08f8d39 100644 --- a/tests/gis_tests/geoapp/test_functions.py +++ b/tests/gis_tests/geoapp/test_functions.py @@ -348,20 +348,24 @@ class GISFunctionsTests(FuncTestMixin, TestCase): @skipUnlessDBFeature("has_FromWKB_function") def test_fromwkb(self): g = Point(56.811078, 60.608647) - g2 = City.objects.values_list( + pt1, pt2 = City.objects.values_list( functions.FromWKB(Value(g.wkb.tobytes())), - flat=True, + functions.FromWKB(Value(g.wkb.tobytes()), srid=4326), )[0] - self.assertIs(g.equals_exact(g2, 0.00001), True) + self.assertIs(g.equals_exact(pt1, 0.00001), True) + self.assertIsNone(pt1.srid) + self.assertEqual(pt2.srid, 4326) @skipUnlessDBFeature("has_FromWKT_function") def test_fromwkt(self): g = Point(56.811078, 60.608647) - g2 = City.objects.values_list( + pt1, pt2 = City.objects.values_list( functions.FromWKT(Value(g.wkt)), - flat=True, + functions.FromWKT(Value(g.wkt), srid=4326), )[0] - self.assertIs(g.equals_exact(g2, 0.00001), True) + self.assertIs(g.equals_exact(pt1, 0.00001), True) + self.assertIsNone(pt1.srid) + self.assertEqual(pt2.srid, 4326) @skipUnlessDBFeature("has_GeoHash_function") def test_geohash(self): |
