(self)
| 1529 | ) |
| 1530 | |
| 1531 | def test_field_with_no_errors(self): |
| 1532 | msg = ( |
| 1533 | "The errors of field 'field' on form <TestForm bound=True, valid=True, " |
| 1534 | "fields=(field)> don't match." |
| 1535 | ) |
| 1536 | with self.assertRaisesMessage(AssertionError, msg) as ctx: |
| 1537 | self.assertFormError(TestForm.valid(), "field", "invalid value") |
| 1538 | self.assertIn("[] != ['invalid value']", str(ctx.exception)) |
| 1539 | msg_prefix = "Custom prefix" |
| 1540 | with self.assertRaisesMessage(AssertionError, f"{msg_prefix}: {msg}"): |
| 1541 | self.assertFormError( |
| 1542 | TestForm.valid(), "field", "invalid value", msg_prefix=msg_prefix |
| 1543 | ) |
| 1544 | |
| 1545 | def test_field_with_different_error(self): |
| 1546 | msg = ( |
nothing calls this directly
no test coverage detected