mirror of
https://github.com/django/django.git
synced 2025-07-28 15:44:20 +00:00
Fixed #34080 -- Fixed __exact lookup when nested arrays contain only NULL values.
Thanks jerch and David Sanders for reviews.
This commit is contained in:
parent
34d63d5a41
commit
3dc9f3ac69
2 changed files with 28 additions and 1 deletions
|
@ -253,6 +253,24 @@ class TestQuerying(PostgreSQLTestCase):
|
|||
[obj],
|
||||
)
|
||||
|
||||
def test_exact_null_only_nested_array(self):
|
||||
obj1 = NullableIntegerArrayModel.objects.create(field_nested=[[None, None]])
|
||||
obj2 = NullableIntegerArrayModel.objects.create(
|
||||
field_nested=[[None, None], [None, None]],
|
||||
)
|
||||
self.assertSequenceEqual(
|
||||
NullableIntegerArrayModel.objects.filter(
|
||||
field_nested__exact=[[None, None]],
|
||||
),
|
||||
[obj1],
|
||||
)
|
||||
self.assertSequenceEqual(
|
||||
NullableIntegerArrayModel.objects.filter(
|
||||
field_nested__exact=[[None, None], [None, None]],
|
||||
),
|
||||
[obj2],
|
||||
)
|
||||
|
||||
def test_exact_with_expression(self):
|
||||
self.assertSequenceEqual(
|
||||
NullableIntegerArrayModel.objects.filter(field__exact=[Value(1)]),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue