mirror of
https://github.com/django/django.git
synced 2024-12-22 17:16:24 +00:00
Refs #33348 -- Fixed SimpleTestCase.assertFormError() error message raised for unbound forms.
This commit is contained in:
parent
d84cd91e90
commit
d4c9dab74b
@ -1448,6 +1448,9 @@ class AssertFormErrorTests(SimpleTestCase):
|
||||
response = mock.Mock(context=[{"form": TestForm()}])
|
||||
with self.assertRaisesMessage(AssertionError, msg):
|
||||
self.assertFormError(response, "form", "field", [])
|
||||
msg_prefix = "Custom prefix"
|
||||
with self.assertRaisesMessage(AssertionError, f"{msg_prefix}: {msg}"):
|
||||
self.assertFormError(response, "form", "field", [], msg_prefix=msg_prefix)
|
||||
|
||||
def test_empty_errors_valid_form(self):
|
||||
response = mock.Mock(context=[{"form": TestForm.valid()}])
|
||||
|
Loading…
Reference in New Issue
Block a user