1
0
mirror of https://github.com/django/django.git synced 2024-12-22 17:16:24 +00:00

Refs #31910 -- Fixed GeoQuerySetTest.test_geoagg_subquery() test on Oracle 18c.

This commit is contained in:
Mariusz Felisiak 2020-11-06 08:48:11 +01:00 committed by GitHub
parent 658bcc16f1
commit 13b6fff117
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -596,12 +596,12 @@ class GeoQuerySetTest(TestCase):
@skipUnlessDBFeature('supports_union_aggr') @skipUnlessDBFeature('supports_union_aggr')
def test_geoagg_subquery(self): def test_geoagg_subquery(self):
ks = State.objects.get(name='Kansas') tx = Country.objects.get(name='Texas')
union = GEOSGeometry('MULTIPOINT(-95.235060 38.971823)') union = GEOSGeometry('MULTIPOINT(-96.801611 32.782057,-95.363151 29.763374)')
# Use distinct() to force the usage of a subquery for aggregation. # Use distinct() to force the usage of a subquery for aggregation.
with CaptureQueriesContext(connection) as ctx: with CaptureQueriesContext(connection) as ctx:
self.assertIs(union.equals( self.assertIs(union.equals(
City.objects.filter(point__within=ks.poly).distinct().aggregate( City.objects.filter(point__within=tx.mpoly).distinct().aggregate(
Union('point'), Union('point'),
)['point__union'], )['point__union'],
), True) ), True)