diff options
author | Tim Graham <timograham@gmail.com> | 2015-05-13 09:52:19 -0400 |
---|---|---|
committer | Tim Graham <timograham@gmail.com> | 2015-05-13 10:31:59 -0400 |
commit | 3c8fe5dddf34533a419d2deed5208a28de32cb4a (patch) | |
tree | ada2a961ac10d89bb02270d5f05d2b96aabc4b9d /tests/postgres_tests/test_hstore.py | |
parent | 81d4ce4a6d21f0e65cabb253927770b3616cb560 (diff) | |
download | django-3c8fe5dddf34533a419d2deed5208a28de32cb4a.tar.gz |
Fixed #24751 -- Fixed HStoreField isnull lookup.
Diffstat (limited to 'tests/postgres_tests/test_hstore.py')
-rw-r--r-- | tests/postgres_tests/test_hstore.py | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/tests/postgres_tests/test_hstore.py b/tests/postgres_tests/test_hstore.py index ed88e2fab5..e63eda46b9 100644 --- a/tests/postgres_tests/test_hstore.py +++ b/tests/postgres_tests/test_hstore.py @@ -114,6 +114,17 @@ class TestQuerying(PostgresSQLTestCase): 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(PostgresSQLTestCase): test_data = '[{"fields": {"field": "{\\"a\\": \\"b\\"}"}, "model": "postgres_tests.hstoremodel", "pk": null}]' |