1
0
mirror of https://github.com/django/django.git synced 2025-10-31 09:41:08 +00:00

Fixed #27964 -- Made MySQL backend raise exception if spatial transformation is needed for query.

This commit is contained in:
Sergey Fedoseev
2017-06-26 16:42:31 +05:00
committed by Tim Graham
parent 964e490847
commit 44a7b98abb
6 changed files with 29 additions and 19 deletions

View File

@@ -270,7 +270,7 @@ class GISFunctionsTests(TestCase):
def test_area_with_regular_aggregate(self):
# Create projected country objects, for this test to work on all backends.
for c in Country.objects.all():
CountryWebMercator.objects.create(name=c.name, mpoly=c.mpoly)
CountryWebMercator.objects.create(name=c.name, mpoly=c.mpoly.transform(3857, clone=True))
# Test in projected coordinate system
qs = CountryWebMercator.objects.annotate(area_sum=Sum(functions.Area('mpoly')))
# Some backends (e.g. Oracle) cannot group by multipolygon values, so