diff options
| author | Shai Berger <shai@platonix.com> | 2016-01-26 00:50:46 +0200 |
|---|---|---|
| committer | Tim Graham <timograham@gmail.com> | 2016-02-09 10:04:54 -0500 |
| commit | bb51dc902dc760b6fd03b860335fd99f47e2e13d (patch) | |
| tree | 88a42d1a13d52e5cb725f959163484f8be343f90 /tests | |
| parent | 75143fa13f4f1ad2be84a103f7ce0eef9d06d3b4 (diff) | |
Refs #26112 -- Fixed aggregate GIS test on Oracle.
Made sure the test doesn't try to aggregate over MultiPolygonField and made
AreaField turn decimals into floats on the way from the DB.
Thanks Daniel Wiesmann, Jani Tiainen, and Tim Graham for review and discussion.
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/gis_tests/geoapp/test_functions.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/tests/gis_tests/geoapp/test_functions.py b/tests/gis_tests/geoapp/test_functions.py index aeb1007c56..344fa03e61 100644 --- a/tests/gis_tests/geoapp/test_functions.py +++ b/tests/gis_tests/geoapp/test_functions.py @@ -240,7 +240,9 @@ class GISFunctionsTests(TestCase): CountryWebMercator.objects.create(name=c.name, mpoly=c.mpoly) # Test in projected coordinate system qs = CountryWebMercator.objects.annotate(area_sum=Sum(functions.Area('mpoly'))) - for c in qs: + # Some backends (e.g. Oracle) cannot group by multipolygon values, so + # defer such fields in the aggregation query. + for c in qs.defer('mpoly'): result = c.area_sum # If the result is a measure object, get value. if isinstance(result, Area): |
