mirror of
https://github.com/django/django.git
synced 2025-08-03 18:38:50 +00:00
Fixed #24751 -- Fixed HStoreField isnull lookup.
This commit is contained in:
parent
81d4ce4a6d
commit
3c8fe5dddf
3 changed files with 14 additions and 1 deletions
|
@ -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}]'
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue