summaryrefslogtreecommitdiff
path: root/tests/postgres_tests/test_citext.py
diff options
context:
space:
mode:
authorSimon Charette <charette.s@gmail.com>2017-05-03 01:25:30 -0400
committerSimon Charette <charette.s@gmail.com>2017-05-04 00:02:14 -0400
commitb91868507af08234a30e9a8e7c90b37c561ba315 (patch)
tree332ff103ffcc30c800ffa5df968113b32acd9447 /tests/postgres_tests/test_citext.py
parentf37467ec7a970e3cb9f9f25c370c4072fc994a6e (diff)
Fixed #28161 -- Fixed return type of ArrayField(CITextField()).
Thanks Tim for the review.
Diffstat (limited to 'tests/postgres_tests/test_citext.py')
-rw-r--r--tests/postgres_tests/test_citext.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/tests/postgres_tests/test_citext.py b/tests/postgres_tests/test_citext.py
index f99f3bfa47..0a7012b072 100644
--- a/tests/postgres_tests/test_citext.py
+++ b/tests/postgres_tests/test_citext.py
@@ -4,11 +4,13 @@ strings and thus eliminates the need for operations such as iexact and other
modifiers to enforce use of an index.
"""
from django.db import IntegrityError
+from django.test.utils import modify_settings
from . import PostgreSQLTestCase
from .models import CITestModel
+@modify_settings(INSTALLED_APPS={'append': 'django.contrib.postgres'})
class CITextTestCase(PostgreSQLTestCase):
@classmethod
@@ -17,6 +19,7 @@ class CITextTestCase(PostgreSQLTestCase):
name='JoHn',
email='joHn@johN.com',
description='Average Joe named JoHn',
+ array_field=['JoE', 'jOhn'],
)
def test_equal_lowercase(self):
@@ -34,3 +37,8 @@ class CITextTestCase(PostgreSQLTestCase):
"""
with self.assertRaises(IntegrityError):
CITestModel.objects.create(name='John')
+
+ def test_array_field(self):
+ instance = CITestModel.objects.get()
+ self.assertEqual(instance.array_field, self.john.array_field)
+ self.assertTrue(CITestModel.objects.filter(array_field__contains=['joe']).exists())