From af5983e4f5e8e9737bc6c7c38221b3e7c9914d1a Mon Sep 17 00:00:00 2001 From: Sergey Fedoseev Date: Sat, 17 Dec 2016 14:19:50 +0500 Subject: [PATCH] Removed unneeded SpatiaLite workarounds in GIS tests. --- tests/gis_tests/geoapp/test_functions.py | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/tests/gis_tests/geoapp/test_functions.py b/tests/gis_tests/geoapp/test_functions.py index bd72a365e2..61ae7dc9a6 100644 --- a/tests/gis_tests/geoapp/test_functions.py +++ b/tests/gis_tests/geoapp/test_functions.py @@ -177,8 +177,8 @@ class GISFunctionsTests(TestCase): def test_difference(self): geom = Point(5, 23, srid=4326) qs = Country.objects.annotate(diff=functions.Difference('mpoly', geom)) - # SpatiaLite and Oracle do something screwy with the Texas geometry. - if spatialite or oracle: + # Oracle does something screwy with the Texas geometry. + if oracle: qs = qs.exclude(name='Texas') for c in qs: @@ -189,8 +189,8 @@ class GISFunctionsTests(TestCase): """Testing with mixed SRID (Country has default 4326).""" geom = Point(556597.4, 2632018.6, srid=3857) # Spherical mercator qs = Country.objects.annotate(difference=functions.Difference('mpoly', geom)) - # SpatiaLite and Oracle do something screwy with the Texas geometry. - if spatialite or oracle: + # Oracle does something screwy with the Texas geometry. + if oracle: qs = qs.exclude(name='Texas') for c in qs: self.assertTrue(c.mpoly.difference(geom).equals(c.difference)) @@ -468,15 +468,9 @@ class GISFunctionsTests(TestCase): difference=functions.Difference('mpoly', geom), sym_difference=functions.SymDifference('mpoly', geom), union=functions.Union('mpoly', geom), + intersection=functions.Intersection('mpoly', geom), ) - # For some reason SpatiaLite does something screwy with the Texas geometry here. - # Also, it doesn't like the null intersection. - if spatialite: - qs = qs.exclude(name='Texas') - else: - qs = qs.annotate(intersection=functions.Intersection('mpoly', geom)) - if oracle: # Should be able to execute the queries; however, they won't be the same # as GEOS (because Oracle doesn't use GEOS internally like PostGIS or