MCPcopy
hub / github.com/django/django / assertFormError

Method assertFormError

tests/auth_tests/test_views.py:96–99  ·  view source on GitHub ↗

Assert that error is found in response.context['form'] errors

(self, response, error)

Source from the content-addressed store, hash-verified

94 self.assertNotIn(SESSION_KEY, self.client.session)
95
96 def assertFormError(self, response, error):
97 """Assert that error is found in response.context['form'] errors"""
98 form_errors = list(itertools.chain(*response.context["form"].errors.values()))
99 self.assertIn(str(error), form_errors)
100
101
102@override_settings(ROOT_URLCONF="django.contrib.auth.urls")

Calls 2

chainMethod · 0.45
valuesMethod · 0.45

Tested by

no test coverage detected