diff options
Diffstat (limited to 'tests')
-rw-r--r-- | tests/backends/sqlite/tests.py | 9 | ||||
-rw-r--r-- | tests/custom_lookups/tests.py | 2 | ||||
-rw-r--r-- | tests/gis_tests/distapp/tests.py | 6 | ||||
-rw-r--r-- | tests/gis_tests/geoapp/test_functions.py | 4 | ||||
-rw-r--r-- | tests/gis_tests/geoapp/tests.py | 4 | ||||
-rw-r--r-- | tests/gis_tests/geogapp/tests.py | 4 | ||||
-rw-r--r-- | tests/gis_tests/relatedapp/tests.py | 6 |
7 files changed, 18 insertions, 17 deletions
diff --git a/tests/backends/sqlite/tests.py b/tests/backends/sqlite/tests.py index 3addcc8c34..0c07f95e6f 100644 --- a/tests/backends/sqlite/tests.py +++ b/tests/backends/sqlite/tests.py @@ -4,6 +4,7 @@ import unittest from django.db import connection from django.db.models import Avg, StdDev, Sum, Variance +from django.db.utils import NotSupportedError from django.test import TestCase, TransactionTestCase, override_settings from ..models import Item, Object, Square @@ -34,13 +35,13 @@ class Tests(TestCase): Raise NotImplementedError when aggregating on date/time fields (#19360). """ for aggregate in (Sum, Avg, Variance, StdDev): - with self.assertRaises(NotImplementedError): + with self.assertRaises(NotSupportedError): Item.objects.all().aggregate(aggregate('time')) - with self.assertRaises(NotImplementedError): + with self.assertRaises(NotSupportedError): Item.objects.all().aggregate(aggregate('date')) - with self.assertRaises(NotImplementedError): + with self.assertRaises(NotSupportedError): Item.objects.all().aggregate(aggregate('last_modified')) - with self.assertRaises(NotImplementedError): + with self.assertRaises(NotSupportedError): Item.objects.all().aggregate( **{'complex': aggregate('last_modified') + aggregate('last_modified')} ) diff --git a/tests/custom_lookups/tests.py b/tests/custom_lookups/tests.py index d39ebe6cdc..bdb27a224a 100644 --- a/tests/custom_lookups/tests.py +++ b/tests/custom_lookups/tests.py @@ -319,7 +319,7 @@ class BilateralTransformTests(TestCase): def test_bilateral_inner_qs(self): with register_lookup(models.CharField, UpperBilateralTransform): - msg = 'Bilateral transformations on nested querysets are not supported.' + msg = 'Bilateral transformations on nested querysets are not implemented.' with self.assertRaisesMessage(NotImplementedError, msg): Author.objects.filter(name__upper__in=Author.objects.values_list('name')) 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): |