Refs #29416 -- Fixed GeoExpressionsTests.test_multiple_annotation() on MySQL 5.7+.
Failure introduced in b6e48f514ebe4e31b76e1750e043d4f296e645dc.
This commit is contained in:
parent
8a6fcfdc77
commit
d0ad03cded
@ -3,7 +3,7 @@ from unittest import skipUnless
|
|||||||
from django.contrib.gis.db.models import F, GeometryField, Value, functions
|
from django.contrib.gis.db.models import F, GeometryField, Value, functions
|
||||||
from django.contrib.gis.geos import Point, Polygon
|
from django.contrib.gis.geos import Point, Polygon
|
||||||
from django.db import connection
|
from django.db import connection
|
||||||
from django.db.models import Count
|
from django.db.models import Count, Min
|
||||||
from django.test import TestCase, skipUnlessDBFeature
|
from django.test import TestCase, skipUnlessDBFeature
|
||||||
|
|
||||||
from ..utils import postgis
|
from ..utils import postgis
|
||||||
@ -56,7 +56,7 @@ class GeoExpressionsTests(TestCase):
|
|||||||
poly=Polygon(((1, 1), (1, 2), (2, 2), (2, 1), (1, 1))),
|
poly=Polygon(((1, 1), (1, 2), (2, 2), (2, 1), (1, 1))),
|
||||||
)
|
)
|
||||||
qs = City.objects.values('name').annotate(
|
qs = City.objects.values('name').annotate(
|
||||||
distance=functions.Distance('multifields__point', multi_field.city.point),
|
distance=Min(functions.Distance('multifields__point', multi_field.city.point)),
|
||||||
).annotate(count=Count('multifields'))
|
).annotate(count=Count('multifields'))
|
||||||
self.assertTrue(qs.first())
|
self.assertTrue(qs.first())
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user