From e80a014fceb64a0723174c296710e6b4c04d58d0 Mon Sep 17 00:00:00 2001 From: MichaƂ Pasternak Date: Fri, 27 Oct 2017 23:38:43 +0200 Subject: [2.0.x] Fixed #28749 -- Added subquery support for ArrayField's __in lookup. Backport of e554b72a2a5473f3f1e57a32565758757a9e8e87 from master --- tests/postgres_tests/test_array.py | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'tests/postgres_tests') diff --git a/tests/postgres_tests/test_array.py b/tests/postgres_tests/test_array.py index e2e4ccdeb2..4503a212cc 100644 --- a/tests/postgres_tests/test_array.py +++ b/tests/postgres_tests/test_array.py @@ -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 -- cgit v1.3