diff options
| author | Simon Charette <charette.s@gmail.com> | 2017-04-06 20:28:21 -0400 |
|---|---|---|
| committer | Simon Charette <charette.s@gmail.com> | 2017-04-07 16:47:52 -0400 |
| commit | a354c69055fd818e612ce22eaa2da0576a4b89ee (patch) | |
| tree | ba38fef11f821c00fdac9cb1b7b848ffd2553512 /tests | |
| parent | 67b2b1f116aceee12922d2a8ff832382bca7e8ad (diff) | |
Fixed #28038 -- Restored casting to text of builtin lookups on PostgreSQL.
Reverted 658f1e8 which broke code using __icontains's implicit cast to ::text
on ArrayField.
Thanks Peter J. Farrell for the report.
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/postgres_tests/test_array.py | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/tests/postgres_tests/test_array.py b/tests/postgres_tests/test_array.py index 69ae5f3cda..a11b60e261 100644 --- a/tests/postgres_tests/test_array.py +++ b/tests/postgres_tests/test_array.py @@ -216,6 +216,14 @@ class TestQuerying(PostgreSQLTestCase): self.objs[1:3] ) + def test_icontains(self): + # Using the __icontains lookup with ArrayField is inefficient. + instance = CharArrayModel.objects.create(field=['FoO']) + self.assertSequenceEqual( + CharArrayModel.objects.filter(field__icontains='foo'), + [instance] + ) + def test_contains_charfield(self): # Regression for #22907 self.assertSequenceEqual( |
