diff options
author | Ben Cail <bcail@crossway.org> | 2022-10-26 09:58:08 -0400 |
---|---|---|
committer | Mariusz Felisiak <felisiak.mariusz@gmail.com> | 2022-11-18 05:53:37 +0100 |
commit | fbde929b19754f19cba1d14e86f4c59f4b0a633c (patch) | |
tree | 9263b3d9b21a49d21c0e53c808f862101faf4a3f /tests/postgres_tests/test_array.py | |
parent | 81b1c167bf919ddbd5aa0289f9f3761fc62addf3 (diff) | |
download | django-fbde929b19754f19cba1d14e86f4c59f4b0a633c.tar.gz |
Fixed #26056 -- Added QuerySet.values()/values_list() support for ArrayField's __overlap lookup.
Thanks Mads Jensen and kosz85 and the initial patch.
Diffstat (limited to 'tests/postgres_tests/test_array.py')
-rw-r--r-- | tests/postgres_tests/test_array.py | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/tests/postgres_tests/test_array.py b/tests/postgres_tests/test_array.py index 89603e24a0..9e20ab3baf 100644 --- a/tests/postgres_tests/test_array.py +++ b/tests/postgres_tests/test_array.py @@ -414,6 +414,21 @@ class TestQuerying(PostgreSQLTestCase): [obj_1, obj_2], ) + def test_overlap_values(self): + qs = NullableIntegerArrayModel.objects.filter(order__lt=3) + self.assertCountEqual( + NullableIntegerArrayModel.objects.filter( + field__overlap=qs.values_list("field"), + ), + self.objs[:3], + ) + self.assertCountEqual( + NullableIntegerArrayModel.objects.filter( + field__overlap=qs.values("field"), + ), + self.objs[:3], + ) + def test_lookups_autofield_array(self): qs = ( NullableIntegerArrayModel.objects.filter( |