diff options
| author | Mariusz Felisiak <felisiak.mariusz@gmail.com> | 2019-01-15 00:32:42 +0100 |
|---|---|---|
| committer | Tim Graham <timograham@gmail.com> | 2019-01-14 18:32:42 -0500 |
| commit | 1508e71c5b056ba099097a849b13187dcbfa26a1 (patch) | |
| tree | 21f9c87e5ec13acda4b26518356317e35b335165 | |
| parent | b181aba7dd24c73ec9923c39e35393b0487a5f47 (diff) | |
Relaxed assertions to fix GIS test failures on Oracle 18c.
| -rw-r--r-- | tests/gis_tests/geoapp/test_regress.py | 18 | ||||
| -rw-r--r-- | 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): |
