summaryrefslogtreecommitdiff
path: root/tests/model_forms/tests.py
diff options
context:
space:
mode:
authorMarc Tamlyn <marc.tamlyn@gmail.com>2013-08-06 02:10:45 -0700
committerMarc Tamlyn <marc.tamlyn@gmail.com>2013-08-06 02:10:45 -0700
commit0b771fcf2923cef1b0d759fda79907c39ad733b4 (patch)
tree811f66c4c15a1a30097c895ede76f2477a6bc763 /tests/model_forms/tests.py
parent263b873599a50609df7865ff9cf24c63cd3e82d2 (diff)
parent71093d22b62548fc2667468f1ae9e28f4fef30db (diff)
Merge pull request #1441 from loic/ticket16986
Fixed #16986 -- Model.clean() can report errors on individual fields.
Diffstat (limited to 'tests/model_forms/tests.py')
-rw-r--r--tests/model_forms/tests.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/tests/model_forms/tests.py b/tests/model_forms/tests.py
index 21e3143be6..1404725484 100644
--- a/tests/model_forms/tests.py
+++ b/tests/model_forms/tests.py
@@ -1782,6 +1782,14 @@ class OldFormForXTests(TestCase):
'<ul class="errorlist"><li>Model custom error message.</li></ul>'
)
+ def test_model_clean_error_messages(self) :
+ data = {'name1': 'FORBIDDEN_VALUE', 'name2': 'ABC'}
+ errors = CustomErrorMessageForm(data).errors
+ self.assertHTMLEqual(
+ str(errors['name1']),
+ '<ul class="errorlist"><li>Model.clean() error messages.</li></ul>'
+ )
+
class M2mHelpTextTest(TestCase):
"""Tests for ticket #9321."""