summaryrefslogtreecommitdiff
path: root/tests/postgres_tests
diff options
context:
space:
mode:
authorTim Graham <timograham@gmail.com>2015-05-13 09:52:19 -0400
committerTim Graham <timograham@gmail.com>2015-05-13 10:34:15 -0400
commitdf0674eabb898d87d8267c5ade026dbf17fd01a8 (patch)
tree0e33f4db711dbe6039ab75d1cd12acea7960d5a0 /tests/postgres_tests
parent7ea6477b3ad3a0da3196e5d3f5f09369e76c8cc5 (diff)
[1.8.x] Fixed #24751 -- Fixed HStoreField isnull lookup.
Backport of 3c8fe5dddf34533a419d2deed5208a28de32cb4a from master
Diffstat (limited to 'tests/postgres_tests')
-rw-r--r--tests/postgres_tests/test_hstore.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/tests/postgres_tests/test_hstore.py b/tests/postgres_tests/test_hstore.py
index 06544163f8..8b2cc883dc 100644
--- a/tests/postgres_tests/test_hstore.py
+++ b/tests/postgres_tests/test_hstore.py
@@ -110,6 +110,17 @@ class TestQuerying(TestCase):
self.objs[:3]
)
+ def test_key_isnull(self):
+ obj = HStoreModel.objects.create(field={'a': None})
+ self.assertSequenceEqual(
+ HStoreModel.objects.filter(field__a__isnull=True),
+ self.objs[2:5] + [obj]
+ )
+ self.assertSequenceEqual(
+ HStoreModel.objects.filter(field__a__isnull=False),
+ self.objs[:2]
+ )
+
class TestSerialization(TestCase):
test_data = '[{"fields": {"field": "{\\"a\\": \\"b\\"}"}, "model": "postgres_tests.hstoremodel", "pk": null}]'