From 374c2419e5adef53a643bf69c4753a6bf0c78a98 Mon Sep 17 00:00:00 2001 From: Sander Smits Date: Fri, 16 Jan 2015 20:10:25 +0100 Subject: [PATCH] Tested that geo aggregates support slicing Refs #15101. Patch slightly reworked by Claude Paroz. --- django/contrib/gis/tests/geoapp/tests.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/django/contrib/gis/tests/geoapp/tests.py b/django/contrib/gis/tests/geoapp/tests.py index c98d244235..b5b765d21b 100644 --- a/django/contrib/gis/tests/geoapp/tests.py +++ b/django/contrib/gis/tests/geoapp/tests.py @@ -493,6 +493,15 @@ class GeoQuerySetTest(TestCase): self.assertIsNone(City.objects.filter(name=('Smalltown')).extent()) self.assertIsNone(City.objects.filter(name=('Smalltown')).aggregate(Extent('point'))['point__extent']) + @skipUnlessDBFeature("supports_extent_aggr") + def test_extent_with_limit(self): + """ + Testing if extent supports limit. + """ + extent1 = City.objects.all().aggregate(Extent('point'))['point__extent'] + extent2 = City.objects.all()[:3].aggregate(Extent('point'))['point__extent'] + self.assertNotEqual(extent1, extent2) + @skipUnlessDBFeature("has_force_rhr_method") def test_force_rhr(self): "Testing GeoQuerySet.force_rhr()."