summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorSergey Fedoseev <fedoseev.sergey@gmail.com>2016-11-30 22:22:56 +0600
committerTim Graham <timograham@gmail.com>2016-11-30 11:22:56 -0500
commit4464b9b9ad9da921f8b50b4e7e26bb4233e05ca0 (patch)
tree754135766dd9c194add6b3bc43f87b8b7ef33c5c /tests
parente17f40f4b55f5bf624a190e67a0c83af4be043b8 (diff)
Fixed #27556 -- Added Oracle support for IsValid function and isvalid lookup.
Diffstat (limited to 'tests')
-rw-r--r--tests/gis_tests/geoapp/tests.py10
1 files changed, 8 insertions, 2 deletions
diff --git a/tests/gis_tests/geoapp/tests.py b/tests/gis_tests/geoapp/tests.py
index 074162fe14..aede5950cd 100644
--- a/tests/gis_tests/geoapp/tests.py
+++ b/tests/gis_tests/geoapp/tests.py
@@ -295,8 +295,14 @@ class GeoLookupTest(TestCase):
def test_isvalid_lookup(self):
invalid_geom = fromstr('POLYGON((0 0, 0 1, 1 1, 1 0, 1 1, 1 0, 0 0))')
State.objects.create(name='invalid', poly=invalid_geom)
- self.assertEqual(State.objects.filter(poly__isvalid=False).count(), 1)
- self.assertEqual(State.objects.filter(poly__isvalid=True).count(), State.objects.count() - 1)
+ qs = State.objects.all()
+ if oracle:
+ # Kansas has adjacent vertices with distance 6.99244813842e-12
+ # which is smaller than the default Oracle tolerance.
+ qs = qs.exclude(name='Kansas')
+ self.assertEqual(State.objects.filter(name='Kansas', poly__isvalid=False).count(), 1)
+ self.assertEqual(qs.filter(poly__isvalid=False).count(), 1)
+ self.assertEqual(qs.filter(poly__isvalid=True).count(), qs.count() - 1)
@skipUnlessDBFeature("supports_left_right_lookups")
def test_left_right_lookups(self):