summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorSergey Fedoseev <fedoseev.sergey@gmail.com>2017-03-23 23:27:13 +0500
committerTim Graham <timograham@gmail.com>2017-03-23 19:09:04 -0400
commite9149d3eb0ed0ddc8b27b1990eb2b7293c1231cd (patch)
tree36bdda886a26c319d6eadc0cc8f168d3d430f646 /tests
parent7e09fa7f519daf2f9c26587c3da5dc044d84b032 (diff)
Fixed #27603 -- Fixed AsKML when queryset is evaluated more than once.
Diffstat (limited to 'tests')
-rw-r--r--tests/gis_tests/geoapp/test_functions.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/tests/gis_tests/geoapp/test_functions.py b/tests/gis_tests/geoapp/test_functions.py
index ac429dfda9..9896aff5c3 100644
--- a/tests/gis_tests/geoapp/test_functions.py
+++ b/tests/gis_tests/geoapp/test_functions.py
@@ -118,8 +118,11 @@ class GISFunctionsTests(TestCase):
City.objects.annotate(kml=functions.AsKML('name'))
# Ensuring the KML is as expected.
- ptown = City.objects.annotate(kml=functions.AsKML('point', precision=9)).get(name='Pueblo')
+ qs = City.objects.annotate(kml=functions.AsKML('point', precision=9))
+ ptown = qs.get(name='Pueblo')
self.assertEqual('<Point><coordinates>-104.609252,38.255001</coordinates></Point>', ptown.kml)
+ # Same result if the queryset is evaluated again.
+ self.assertEqual(qs.get(name='Pueblo').kml, ptown.kml)
@skipUnlessDBFeature("has_AsSVG_function")
def test_assvg(self):