mirror of
https://github.com/django/django.git
synced 2025-10-23 21:59:11 +00:00
[1.11.x] Fixed #28038 -- Restored casting to text of builtin lookups on PostgreSQL.
Reverted658f1e8which broke code using __icontains's implicit cast to ::text on ArrayField. Thanks Peter J. Farrell for the report. Backport ofa354c69055from master
This commit is contained in:
@@ -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(
|
||||
|
||||
Reference in New Issue
Block a user