summaryrefslogtreecommitdiff
path: root/tests/model_forms/tests.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/model_forms/tests.py')
-rw-r--r--tests/model_forms/tests.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/tests/model_forms/tests.py b/tests/model_forms/tests.py
index 489137bd35..78c3bca416 100644
--- a/tests/model_forms/tests.py
+++ b/tests/model_forms/tests.py
@@ -2207,6 +2207,13 @@ class ModelFormCustomErrorTests(TestCase):
str(form.errors['name1']),
'<ul class="errorlist"><li>Model.clean() error messages.</li></ul>'
)
+ data = {'name1': 'FORBIDDEN_VALUE2', 'name2': 'ABC'}
+ form = CustomErrorMessageForm(data)
+ self.assertFalse(form.is_valid())
+ self.assertHTMLEqual(
+ str(form.errors['name1']),
+ '<ul class="errorlist"><li>Model.clean() error messages (simpler syntax).</li></ul>'
+ )
data = {'name1': 'GLOBAL_ERROR', 'name2': 'ABC'}
form = CustomErrorMessageForm(data)
self.assertFalse(form.is_valid())