summaryrefslogtreecommitdiff
path: root/tests/gis_tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests/gis_tests')
-rw-r--r--tests/gis_tests/distapp/tests.py6
-rw-r--r--tests/gis_tests/geoapp/test_functions.py4
-rw-r--r--tests/gis_tests/geoapp/tests.py4
-rw-r--r--tests/gis_tests/geogapp/tests.py4
-rw-r--r--tests/gis_tests/relatedapp/tests.py6
5 files changed, 12 insertions, 12 deletions
diff --git a/tests/gis_tests/distapp/tests.py b/tests/gis_tests/distapp/tests.py
index d162759513..e9735de074 100644
--- a/tests/gis_tests/distapp/tests.py
+++ b/tests/gis_tests/distapp/tests.py
@@ -5,7 +5,7 @@ from django.contrib.gis.db.models.functions import (
)
from django.contrib.gis.geos import GEOSGeometry, LineString, Point
from django.contrib.gis.measure import D # alias for Distance
-from django.db import connection
+from django.db import NotSupportedError, connection
from django.db.models import F, Q
from django.test import TestCase, skipIfDBFeature, skipUnlessDBFeature
@@ -474,7 +474,7 @@ class DistanceFunctionsTests(FuncTestMixin, TestCase):
# TODO: test with spheroid argument (True and False)
else:
# Does not support geodetic coordinate systems.
- with self.assertRaises(NotImplementedError):
+ with self.assertRaises(NotSupportedError):
list(Interstate.objects.annotate(length=Length('path')))
# Now doing length on a projected coordinate system.
@@ -513,7 +513,7 @@ class DistanceFunctionsTests(FuncTestMixin, TestCase):
if connection.features.supports_perimeter_geodetic:
self.assertAlmostEqual(qs1[0].perim.m, 18406.3818954314, 3)
else:
- with self.assertRaises(NotImplementedError):
+ with self.assertRaises(NotSupportedError):
list(qs1)
# But should work fine when transformed to projected coordinates
qs2 = CensusZipcode.objects.annotate(perim=Perimeter(Transform('poly', 32140))).filter(name='77002')
diff --git a/tests/gis_tests/geoapp/test_functions.py b/tests/gis_tests/geoapp/test_functions.py
index cdd05d78ff..33fe139fb0 100644
--- a/tests/gis_tests/geoapp/test_functions.py
+++ b/tests/gis_tests/geoapp/test_functions.py
@@ -8,7 +8,7 @@ from django.contrib.gis.geos import (
GEOSGeometry, LineString, Point, Polygon, fromstr,
)
from django.contrib.gis.measure import Area
-from django.db import connection
+from django.db import NotSupportedError, connection
from django.db.models import Sum
from django.test import TestCase, skipUnlessDBFeature
@@ -28,7 +28,7 @@ class GISFunctionsTests(FuncTestMixin, TestCase):
def test_asgeojson(self):
# Only PostGIS and SpatiaLite support GeoJSON.
if not connection.features.has_AsGeoJSON_function:
- with self.assertRaises(NotImplementedError):
+ with self.assertRaises(NotSupportedError):
list(Country.objects.annotate(json=functions.AsGeoJSON('mpoly')))
return
diff --git a/tests/gis_tests/geoapp/tests.py b/tests/gis_tests/geoapp/tests.py
index f9838b461b..52a172792a 100644
--- a/tests/gis_tests/geoapp/tests.py
+++ b/tests/gis_tests/geoapp/tests.py
@@ -8,7 +8,7 @@ from django.contrib.gis.geos import (
MultiPoint, MultiPolygon, Point, Polygon, fromstr,
)
from django.core.management import call_command
-from django.db import connection
+from django.db import NotSupportedError, connection
from django.test import TestCase, skipUnlessDBFeature
from ..utils import (
@@ -516,7 +516,7 @@ class GeoQuerySetTest(TestCase):
Testing the `MakeLine` aggregate.
"""
if not connection.features.supports_make_line_aggr:
- with self.assertRaises(NotImplementedError):
+ with self.assertRaises(NotSupportedError):
City.objects.all().aggregate(MakeLine('point'))
return
diff --git a/tests/gis_tests/geogapp/tests.py b/tests/gis_tests/geogapp/tests.py
index c9986fd78b..7f6c441ba5 100644
--- a/tests/gis_tests/geogapp/tests.py
+++ b/tests/gis_tests/geogapp/tests.py
@@ -7,7 +7,7 @@ from unittest import skipIf, skipUnless
from django.contrib.gis.db import models
from django.contrib.gis.db.models.functions import Area, Distance
from django.contrib.gis.measure import D
-from django.db import connection
+from django.db import NotSupportedError, connection
from django.db.models.functions import Cast
from django.test import TestCase, skipIfDBFeature, skipUnlessDBFeature
@@ -152,5 +152,5 @@ class GeographyFunctionTests(FuncTestMixin, TestCase):
@skipUnlessDBFeature("has_Area_function")
@skipIfDBFeature("supports_area_geodetic")
def test_geodetic_area_raises_if_not_supported(self):
- with self.assertRaisesMessage(NotImplementedError, 'Area on geodetic coordinate systems not supported.'):
+ with self.assertRaisesMessage(NotSupportedError, 'Area on geodetic coordinate systems not supported.'):
Zipcode.objects.annotate(area=Area('poly')).get(code='77002')
diff --git a/tests/gis_tests/relatedapp/tests.py b/tests/gis_tests/relatedapp/tests.py
index 8d6b793ce2..ba812fa9fb 100644
--- a/tests/gis_tests/relatedapp/tests.py
+++ b/tests/gis_tests/relatedapp/tests.py
@@ -1,6 +1,6 @@
from django.contrib.gis.db.models import Collect, Count, Extent, F, Union
from django.contrib.gis.geos import GEOSGeometry, MultiPoint, Point
-from django.db import connection
+from django.db import NotSupportedError, connection
from django.test import TestCase, skipUnlessDBFeature
from django.test.utils import override_settings
from django.utils import timezone
@@ -147,7 +147,7 @@ class RelatedGeoModelTest(TestCase):
self.assertEqual('P2', qs.get().name)
else:
msg = "This backend doesn't support the Transform function."
- with self.assertRaisesMessage(NotImplementedError, msg):
+ with self.assertRaisesMessage(NotSupportedError, msg):
list(qs)
# Should return the first Parcel, which has the center point equal
@@ -162,7 +162,7 @@ class RelatedGeoModelTest(TestCase):
self.assertEqual('P1', qs.get().name)
else:
msg = "This backend doesn't support the Transform function."
- with self.assertRaisesMessage(NotImplementedError, msg):
+ with self.assertRaisesMessage(NotSupportedError, msg):
list(qs)
def test07_values(self):