Fixed #28749 -- Added subquery support for ArrayField's __in lookup.

This commit is contained in:
Michał Pasternak 2017-10-27 23:38:43 +02:00 committed by Tim Graham
parent 6e8508734b
commit e554b72a2a
2 changed files with 12 additions and 0 deletions

View file

@ -176,6 +176,15 @@ class TestQuerying(PostgreSQLTestCase):
self.objs[:2]
)
def test_in_subquery(self):
IntegerArrayModel.objects.create(field=[2, 3])
self.assertSequenceEqual(
NullableIntegerArrayModel.objects.filter(
field__in=IntegerArrayModel.objects.all().values_list('field', flat=True)
),
self.objs[2:3]
)
@unittest.expectedFailure
def test_in_including_F_object(self):
# This test asserts that Array objects passed to filters can be