diff options
| author | Mads Jensen <mje@inducks.org> | 2017-11-14 22:51:51 +0100 |
|---|---|---|
| committer | Tim Graham <timograham@gmail.com> | 2017-11-29 11:12:07 -0500 |
| commit | 3545e844885608932a692d952c12cd863e2320b5 (patch) | |
| tree | 68fbeaff7e4309a76184fc15bd38fe7f15caca76 /tests/backends | |
| parent | 899999db4293d40613626833860de28e8ccdd413 (diff) | |
[1.11.x] Fixed #28702 -- Made query lookups for CIText fields use citext.
Backport of f0a68c25118786d47041d0a435b2afa953be3c86 from master
Diffstat (limited to 'tests/backends')
| -rw-r--r-- | tests/backends/tests.py | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/tests/backends/tests.py b/tests/backends/tests.py index 16a20de40d..2217669354 100644 --- a/tests/backends/tests.py +++ b/tests/backends/tests.py @@ -377,9 +377,15 @@ class PostgreSQLTests(TestCase): from django.db.backends.postgresql.operations import DatabaseOperations do = DatabaseOperations(connection=None) - for lookup in ('iexact', 'contains', 'icontains', 'startswith', - 'istartswith', 'endswith', 'iendswith', 'regex', 'iregex'): + lookups = ( + 'iexact', 'contains', 'icontains', 'startswith', 'istartswith', + 'endswith', 'iendswith', 'regex', 'iregex', + ) + for lookup in lookups: self.assertIn('::text', do.lookup_cast(lookup)) + for lookup in lookups: + for field_type in ('CICharField', 'CIEmailField', 'CITextField'): + self.assertIn('::citext', do.lookup_cast(lookup, internal_type=field_type)) def test_correct_extraction_psycopg2_version(self): from django.db.backends.postgresql.base import psycopg2_version |
