mirror of
https://github.com/django/django.git
synced 2025-08-27 14:04:41 +00:00
Fixed #25772 -- Corrected __len lookup on ArrayField for empty arrays.
This commit is contained in:
parent
a3708fda35
commit
88fc9e2826
3 changed files with 15 additions and 1 deletions
|
@ -231,6 +231,13 @@ class TestQuerying(PostgreSQLTestCase):
|
|||
self.objs[0:3]
|
||||
)
|
||||
|
||||
def test_len_empty_array(self):
|
||||
obj = NullableIntegerArrayModel.objects.create(field=[])
|
||||
self.assertSequenceEqual(
|
||||
NullableIntegerArrayModel.objects.filter(field__len=0),
|
||||
[obj]
|
||||
)
|
||||
|
||||
def test_slice(self):
|
||||
self.assertSequenceEqual(
|
||||
NullableIntegerArrayModel.objects.filter(field__0_1=[2]),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue