diff options
| author | Sergey Fedoseev <fedoseev.sergey@gmail.com> | 2017-03-23 23:27:13 +0500 |
|---|---|---|
| committer | Tim Graham <timograham@gmail.com> | 2017-03-23 19:31:23 -0400 |
| commit | b6a6787fd857813801dbcd63ac6672da355af998 (patch) | |
| tree | 4a3e6716401d3a45fadf20d702f4f2444cf7558f /tests | |
| parent | a8c540accc7eb526e44ec2bc05881eb300f54530 (diff) | |
[1.11.x] Fixed #27603 -- Fixed AsKML when queryset is evaluated more than once.
Backport of e9149d3eb0ed0ddc8b27b1990eb2b7293c1231cd from master
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/gis_tests/geoapp/test_functions.py | 5 |
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 61ae7dc9a6..56ba63673b 100644 --- a/tests/gis_tests/geoapp/test_functions.py +++ b/tests/gis_tests/geoapp/test_functions.py @@ -122,8 +122,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): |
