diff options
| author | Mariusz Felisiak <felisiak.mariusz@gmail.com> | 2022-02-15 10:14:19 +0100 |
|---|---|---|
| committer | Mariusz Felisiak <felisiak.mariusz@gmail.com> | 2022-02-15 10:16:06 +0100 |
| commit | d4c9dab74bc29c240c33879a1167e5fd0971c7bc (patch) | |
| tree | 69170334d9a11a4e85ef50e02f408609cd845ea9 /tests/test_utils | |
| parent | d84cd91e90cb0871e43f98cba8c53be99053e903 (diff) | |
Refs #33348 -- Fixed SimpleTestCase.assertFormError() error message raised for unbound forms.
Diffstat (limited to 'tests/test_utils')
| -rw-r--r-- | tests/test_utils/tests.py | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/tests/test_utils/tests.py b/tests/test_utils/tests.py index 506773b712..92778439ed 100644 --- a/tests/test_utils/tests.py +++ b/tests/test_utils/tests.py @@ -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()}]) |
