summaryrefslogtreecommitdiff
path: root/tests/postgres_tests/test_citext.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/postgres_tests/test_citext.py')
-rw-r--r--tests/postgres_tests/test_citext.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/tests/postgres_tests/test_citext.py b/tests/postgres_tests/test_citext.py
index f1c13184b6..314f2e40d3 100644
--- a/tests/postgres_tests/test_citext.py
+++ b/tests/postgres_tests/test_citext.py
@@ -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()