summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMariusz Felisiak <felisiak.mariusz@gmail.com>2018-05-31 16:38:42 +0200
committerTim Graham <timograham@gmail.com>2018-05-31 10:45:46 -0400
commitb57ea27d6b25e200a780e8dff07b8289d8e6c844 (patch)
tree437a8ab5e585c9e1744f9229cded23de6a6e8688
parent904adcc034c1a634767428078d225583d6e6dd76 (diff)
[2.0.x] Refs #29416 -- Fixed GeoExpressionsTests.test_multiple_annotation() on MySQL 5.7+.
Failure introduced in b6e48f514ebe4e31b76e1750e043d4f296e645dc. Backport of d0ad03cded64fc307b15668c81d0c65fd8486eff from master
-rw-r--r--tests/gis_tests/geoapp/test_expressions.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/tests/gis_tests/geoapp/test_expressions.py b/tests/gis_tests/geoapp/test_expressions.py
index 2d0ebbcae0..89e83a782f 100644
--- a/tests/gis_tests/geoapp/test_expressions.py
+++ b/tests/gis_tests/geoapp/test_expressions.py
@@ -3,7 +3,7 @@ from unittest import skipUnless
from django.contrib.gis.db.models import F, GeometryField, Value, functions
from django.contrib.gis.geos import Point, Polygon
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 ..utils import postgis
@@ -56,7 +56,7 @@ class GeoExpressionsTests(TestCase):
poly=Polygon(((1, 1), (1, 2), (2, 2), (2, 1), (1, 1))),
)
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'))
self.assertTrue(qs.first())