summaryrefslogtreecommitdiff
path: root/tests/forms_tests
diff options
context:
space:
mode:
authorMariusz Felisiak <felisiak.mariusz@gmail.com>2021-01-13 12:29:58 +0100
committerMariusz Felisiak <felisiak.mariusz@gmail.com>2021-01-14 17:50:04 +0100
commitbf770cc825f1af294b3b2853b39b5b161b6a056f (patch)
tree45b67f4ca5817e5a3da268cd1b83454e93aef01c /tests/forms_tests
parent1adcf20385c2856d3655089ff7a0b55b32e5587a (diff)
downloaddjango-bf770cc825f1af294b3b2853b39b5b161b6a056f.tar.gz
Refs #8760 -- Removed "list" message for ModelMultipleChoiceField per deprecation timeline.
Diffstat (limited to 'tests/forms_tests')
-rw-r--r--tests/forms_tests/tests/test_error_messages.py24
1 files changed, 1 insertions, 23 deletions
diff --git a/tests/forms_tests/tests/test_error_messages.py b/tests/forms_tests/tests/test_error_messages.py
index d60acc1daa..1a6d1386c3 100644
--- a/tests/forms_tests/tests/test_error_messages.py
+++ b/tests/forms_tests/tests/test_error_messages.py
@@ -8,8 +8,7 @@ from django.forms import (
SplitDateTimeField, TimeField, URLField, utils,
)
from django.template import Context, Template
-from django.test import SimpleTestCase, TestCase, ignore_warnings
-from django.utils.deprecation import RemovedInDjango40Warning
+from django.test import SimpleTestCase, TestCase
from django.utils.safestring import mark_safe
from ..models import ChoiceModel
@@ -309,24 +308,3 @@ class ModelChoiceFieldErrorMessagesTestCase(TestCase, AssertFormErrorsMixin):
self.assertFormErrors(['REQUIRED'], f.clean, '')
self.assertFormErrors(['NOT A LIST OF VALUES'], f.clean, '3')
self.assertFormErrors(['4 IS INVALID CHOICE'], f.clean, ['4'])
-
-
-class DeprecationTests(TestCase, AssertFormErrorsMixin):
- @ignore_warnings(category=RemovedInDjango40Warning)
- def test_list_error_message(self):
- f = ModelMultipleChoiceField(
- queryset=ChoiceModel.objects.all(),
- error_messages={'list': 'NOT A LIST OF VALUES'},
- )
- self.assertFormErrors(['NOT A LIST OF VALUES'], f.clean, '3')
-
- def test_list_error_message_warning(self):
- msg = (
- "The 'list' error message key is deprecated in favor of "
- "'invalid_list'."
- )
- with self.assertRaisesMessage(RemovedInDjango40Warning, msg):
- ModelMultipleChoiceField(
- queryset=ChoiceModel.objects.all(),
- error_messages={'list': 'NOT A LIST OF VALUES'},
- )