1
0
mirror of https://github.com/django/django.git synced 2025-02-20 22:34:31 +00:00
django/tests/postgres_tests/test_json_deprecation.py
2021-01-14 17:50:04 +01:00

19 lines
530 B
Python

try:
from django.contrib.postgres import forms
except ImportError:
pass
from django.utils.deprecation import RemovedInDjango40Warning
from . import PostgreSQLSimpleTestCase
class DeprecationTests(PostgreSQLSimpleTestCase):
def test_form_field_deprecation_message(self):
msg = (
'django.contrib.postgres.forms.JSONField is deprecated in favor '
'of django.forms.JSONField.'
)
with self.assertWarnsMessage(RemovedInDjango40Warning, msg):
forms.JSONField()