summaryrefslogtreecommitdiff
path: root/tests/postgres_tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests/postgres_tests')
-rw-r--r--tests/postgres_tests/test_json.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/tests/postgres_tests/test_json.py b/tests/postgres_tests/test_json.py
index fd4db7fae4..aeaae0de34 100644
--- a/tests/postgres_tests/test_json.py
+++ b/tests/postgres_tests/test_json.py
@@ -156,6 +156,17 @@ class TestQuerying(TestCase):
[self.objs[0]]
)
+ def test_isnull_key(self):
+ # key__isnull works the same as has_key='key'.
+ self.assertSequenceEqual(
+ JSONModel.objects.filter(field__a__isnull=True),
+ self.objs[:7] + self.objs[9:]
+ )
+ self.assertSequenceEqual(
+ JSONModel.objects.filter(field__a__isnull=False),
+ [self.objs[7], self.objs[8]]
+ )
+
def test_contains(self):
self.assertSequenceEqual(
JSONModel.objects.filter(field__contains={'a': 'b'}),