MCPcopy
hub / github.com/django/django / test_unbound_form

Method test_unbound_form

tests/test_utils/tests.py:1559–1568  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

1557 )
1558
1559 def test_unbound_form(self):
1560 msg = (
1561 "The form <TestForm bound=False, valid=Unknown, fields=(field)> is not "
1562 "bound, it will never have any errors."
1563 )
1564 with self.assertRaisesMessage(AssertionError, msg):
1565 self.assertFormError(TestForm(), "field", [])
1566 msg_prefix = "Custom prefix"
1567 with self.assertRaisesMessage(AssertionError, f"{msg_prefix}: {msg}"):
1568 self.assertFormError(TestForm(), "field", [], msg_prefix=msg_prefix)
1569
1570 def test_empty_errors_invalid_form(self):
1571 msg = (

Callers

nothing calls this directly

Calls 3

assertRaisesMessageMethod · 0.80
TestFormClass · 0.70
assertFormErrorMethod · 0.45

Tested by

no test coverage detected