From 1508e71c5b056ba099097a849b13187dcbfa26a1 Mon Sep 17 00:00:00 2001 From: Mariusz Felisiak Date: Tue, 15 Jan 2019 00:32:42 +0100 Subject: [PATCH] Relaxed assertions to fix GIS test failures on Oracle 18c. --- tests/gis_tests/geoapp/test_regress.py | 18 +++++++++++------- tests/gis_tests/relatedapp/tests.py | 3 ++- 2 files changed, 13 insertions(+), 8 deletions(-) diff --git a/tests/gis_tests/geoapp/test_regress.py b/tests/gis_tests/geoapp/test_regress.py index 7c4eb7f4df..661124dcba 100644 --- a/tests/gis_tests/geoapp/test_regress.py +++ b/tests/gis_tests/geoapp/test_regress.py @@ -14,15 +14,19 @@ class GeoRegressionTests(TestCase): def test_update(self): "Testing QuerySet.update() (#10411)." - pnt = City.objects.get(name='Pueblo').point - bak = pnt.clone() - pnt.y += 0.005 - pnt.x += 0.005 + pueblo = City.objects.get(name='Pueblo') + bak = pueblo.point.clone() + pueblo.point.y += 0.005 + pueblo.point.x += 0.005 - City.objects.filter(name='Pueblo').update(point=pnt) - self.assertEqual(pnt, City.objects.get(name='Pueblo').point) + City.objects.filter(name='Pueblo').update(point=pueblo.point) + pueblo.refresh_from_db() + self.assertAlmostEqual(bak.y + 0.005, pueblo.point.y, 6) + self.assertAlmostEqual(bak.x + 0.005, pueblo.point.x, 6) City.objects.filter(name='Pueblo').update(point=bak) - self.assertEqual(bak, City.objects.get(name='Pueblo').point) + pueblo.refresh_from_db() + self.assertAlmostEqual(bak.y, pueblo.point.y, 6) + self.assertAlmostEqual(bak.x, pueblo.point.x, 6) def test_kmz(self): "Testing `render_to_kmz` with non-ASCII data. See #11624." diff --git a/tests/gis_tests/relatedapp/tests.py b/tests/gis_tests/relatedapp/tests.py index ba812fa9fb..5f003b78f2 100644 --- a/tests/gis_tests/relatedapp/tests.py +++ b/tests/gis_tests/relatedapp/tests.py @@ -32,7 +32,8 @@ class RelatedGeoModelTest(TestCase): nm, st, lon, lat = ref self.assertEqual(nm, c.name) self.assertEqual(st, c.state) - self.assertEqual(Point(lon, lat, srid=c.location.point.srid), c.location.point) + self.assertAlmostEqual(lon, c.location.point.x, 6) + self.assertAlmostEqual(lat, c.location.point.y, 6) @skipUnlessDBFeature("supports_extent_aggr") def test_related_extent_aggregate(self):