Tested that geo aggregates support slicing

Refs #15101. Patch slightly reworked by Claude Paroz.
This commit is contained in:
Sander Smits 2015-01-16 20:10:25 +01:00 committed by Claude Paroz
parent a79e6b6717
commit 374c2419e5
1 changed files with 9 additions and 0 deletions

View File

@ -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()."