mirror of
https://github.com/django/django.git
synced 2025-10-24 14:16:09 +00:00
Fixed #33872 -- Deprecated django.contrib.postgres.fields.CIText/CICharField/CIEmailField/CITextField.
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
# RemovedInDjango51Warning.
|
||||
"""
|
||||
The citext PostgreSQL extension supports indexing of case-insensitive text
|
||||
strings and thus eliminates the need for operations such as iexact and other
|
||||
@@ -5,6 +6,7 @@ modifiers to enforce use of an index.
|
||||
"""
|
||||
from django.db import IntegrityError
|
||||
from django.test.utils import modify_settings
|
||||
from django.utils.deprecation import RemovedInDjango51Warning
|
||||
|
||||
from . import PostgreSQLTestCase
|
||||
from .models import CITestModel
|
||||
@@ -82,3 +84,10 @@ class CITextTestCase(PostgreSQLTestCase):
|
||||
self.assertSequenceEqual(
|
||||
CITestModel.objects.filter(**query), [self.john]
|
||||
)
|
||||
|
||||
def test_citext_deprecated(self):
|
||||
from django.contrib.postgres.fields import CIText
|
||||
|
||||
msg = "django.contrib.postgres.fields.CIText mixin is deprecated."
|
||||
with self.assertRaisesMessage(RemovedInDjango51Warning, msg):
|
||||
CIText()
|
||||
|
||||
Reference in New Issue
Block a user