(self)
| 1513 | self.assertFormError(TestForm.valid(), None, []) |
| 1514 | |
| 1515 | def test_field_not_in_form(self): |
| 1516 | msg = ( |
| 1517 | "The form <TestForm bound=True, valid=False, fields=(field)> does not " |
| 1518 | "contain the field 'other_field'." |
| 1519 | ) |
| 1520 | with self.assertRaisesMessage(AssertionError, msg): |
| 1521 | self.assertFormError(TestForm.invalid(), "other_field", "invalid value") |
| 1522 | msg_prefix = "Custom prefix" |
| 1523 | with self.assertRaisesMessage(AssertionError, f"{msg_prefix}: {msg}"): |
| 1524 | self.assertFormError( |
| 1525 | TestForm.invalid(), |
| 1526 | "other_field", |
| 1527 | "invalid value", |
| 1528 | msg_prefix=msg_prefix, |
| 1529 | ) |
| 1530 | |
| 1531 | def test_field_with_no_errors(self): |
| 1532 | msg = ( |
nothing calls this directly
no test coverage detected