Assert that a field named "field" on the given form object has specific errors. errors can be either a single error message or a list of errors messages. Using errors=[] test that the field has no errors. You can pass field=None to check the form's non-fiel
(self, form, field, errors, msg_prefix="")
| 696 | self.assertEqual(field_errors, errors, msg_prefix + failure_message) |
| 697 | |
| 698 | def assertFormError(self, form, field, errors, msg_prefix=""): |
| 699 | """ |
| 700 | Assert that a field named "field" on the given form object has specific |
| 701 | errors. |
| 702 | |
| 703 | errors can be either a single error message or a list of errors |
| 704 | messages. Using errors=[] test that the field has no errors. |
| 705 | |
| 706 | You can pass field=None to check the form's non-field errors. |
| 707 | """ |
| 708 | if msg_prefix: |
| 709 | msg_prefix += ": " |
| 710 | errors = to_list(errors) |
| 711 | self._assert_form_error(form, field, errors, msg_prefix) |
| 712 | |
| 713 | def assertFormSetError(self, formset, form_index, field, errors, msg_prefix=""): |
| 714 | """ |
nothing calls this directly
no test coverage detected