summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorSergey Fedoseev <fedoseev.sergey@gmail.com>2017-12-06 14:59:30 +0500
committerTim Graham <timograham@gmail.com>2017-12-12 17:15:29 -1000
commitce26ec01631b00f1d0062a18c79abc93c489b75d (patch)
tree843b4dd3378da2869c302f180b23847d12b4953b /tests
parenta5c60404476124c682c996bfb1eb077d59f1ec53 (diff)
[2.0.x] Fixed #28896 -- Reallowed filtering a queryset with GeometryField=None.
Regression in 58da81a5a372a69f0bac801c412b57f3cce5f188. Backport of da71e4bb086593b5ca76bf698358d27ead2cfed2 from master
Diffstat (limited to 'tests')
-rw-r--r--tests/gis_tests/geoapp/tests.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/tests/gis_tests/geoapp/tests.py b/tests/gis_tests/geoapp/tests.py
index 5170e31157..2a682c904d 100644
--- a/tests/gis_tests/geoapp/tests.py
+++ b/tests/gis_tests/geoapp/tests.py
@@ -385,6 +385,9 @@ class GeoLookupTest(TestCase):
# Puerto Rico should be NULL (it's a commonwealth unincorporated territory)
self.assertEqual(1, len(nullqs))
self.assertEqual('Puerto Rico', nullqs[0].name)
+ # GeometryField=None is an alias for __isnull=True.
+ self.assertCountEqual(State.objects.filter(poly=None), nullqs)
+ self.assertCountEqual(State.objects.exclude(poly=None), validqs)
# The valid states should be Colorado & Kansas
self.assertEqual(2, len(validqs))