summaryrefslogtreecommitdiff
path: root/django/contrib/gis
diff options
context:
space:
mode:
authorClaude Paroz <claude@2xlibre.net>2015-01-17 10:01:17 +0100
committerClaude Paroz <claude@2xlibre.net>2015-01-17 10:01:55 +0100
commitd69ecf922ddf6d4e3698e0dfd42d9ae387df182c (patch)
treed98292f1703841651e321a7e6d2ec6c264bb1a4d /django/contrib/gis
parentd60b96d98881b47c845125e82269ea6a9b268fbb (diff)
downloaddjango-d69ecf922ddf6d4e3698e0dfd42d9ae387df182c.tar.gz
Complemented test about non-supported aggregation exception
Diffstat (limited to 'django/contrib/gis')
-rw-r--r--django/contrib/gis/tests/geoapp/tests.py11
1 files changed, 9 insertions, 2 deletions
diff --git a/django/contrib/gis/tests/geoapp/tests.py b/django/contrib/gis/tests/geoapp/tests.py
index b5b765d21b..8d20ef843a 100644
--- a/django/contrib/gis/tests/geoapp/tests.py
+++ b/django/contrib/gis/tests/geoapp/tests.py
@@ -630,14 +630,21 @@ class GeoQuerySetTest(TestCase):
for ptown in [ptown1, ptown2]:
self.assertEqual('<Point><coordinates>-104.609252,38.255001</coordinates></Point>', ptown.kml)
- # Only PostGIS has support for the MakeLine aggregate.
- @skipUnlessDBFeature("supports_make_line_aggr")
@ignore_warnings(category=RemovedInDjango20Warning)
def test_make_line(self):
"""
Testing the (deprecated) `make_line` GeoQuerySet method and the MakeLine
aggregate.
"""
+ if not connection.features.supports_make_line_aggr:
+ # Only PostGIS has support for the MakeLine aggregate. For other
+ # backends, test that NotImplementedError is raised
+ self.assertRaises(
+ NotImplementedError,
+ City.objects.all().aggregate, MakeLine('point')
+ )
+ return
+
# Ensuring that a `TypeError` is raised on models without PointFields.
self.assertRaises(TypeError, State.objects.make_line)
self.assertRaises(TypeError, Country.objects.make_line)