1
0
mirror of https://github.com/django/django.git synced 2025-10-24 06:06:09 +00:00

Fixed #28161 -- Fixed return type of ArrayField(CITextField()).

Thanks Tim for the review.
This commit is contained in:
Simon Charette
2017-05-03 01:25:30 -04:00
parent f37467ec7a
commit b91868507a
8 changed files with 40 additions and 15 deletions

View File

@@ -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())