summaryrefslogtreecommitdiff
path: root/tests/forms_tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests/forms_tests')
-rw-r--r--tests/forms_tests/tests/test_forms.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/tests/forms_tests/tests/test_forms.py b/tests/forms_tests/tests/test_forms.py
index 8cc1fecf0a..7f698ad706 100644
--- a/tests/forms_tests/tests/test_forms.py
+++ b/tests/forms_tests/tests/test_forms.py
@@ -1660,6 +1660,13 @@ aria-describedby="id_birthday_error">
with self.assertRaisesMessage(ValueError, "has no field named"):
f.add_error("missing_field", "Some error.")
+ with self.assertRaisesMessage(
+ TypeError,
+ "The argument `field` must be `None` when the `error` argument is a "
+ "dictionary.",
+ ):
+ f.add_error("password1", ValidationError({"password1": "Some error."}))
+
def test_update_error_dict(self):
class CodeForm(Form):
code = CharField(max_length=10)