mirror of https://github.com/django/django.git
Simplified SimpleTestCase.assertFormError()/assertFormsetErrors() calls in admin_views tests.
This commit is contained in:
parent
1f749d6f12
commit
261885e4c1
|
@ -7816,12 +7816,7 @@ class AdminViewOnSiteTests(TestCase):
|
||||||
self.assertFormError(
|
self.assertFormError(
|
||||||
response, "adminform", "some_required_info", ["This field is required."]
|
response, "adminform", "some_required_info", ["This field is required."]
|
||||||
)
|
)
|
||||||
msg = (
|
self.assertFormError(response, "adminform", None, [])
|
||||||
"The form 'adminform' in context 0 does not contain the non-field error "
|
|
||||||
"'Error'"
|
|
||||||
)
|
|
||||||
with self.assertRaisesMessage(AssertionError, msg):
|
|
||||||
self.assertFormError(response, "adminform", None, ["Error"])
|
|
||||||
self.assertFormsetError(
|
self.assertFormsetError(
|
||||||
response,
|
response,
|
||||||
"inline_admin_formset",
|
"inline_admin_formset",
|
||||||
|
@ -7832,14 +7827,7 @@ class AdminViewOnSiteTests(TestCase):
|
||||||
"contrived test case"
|
"contrived test case"
|
||||||
],
|
],
|
||||||
)
|
)
|
||||||
msg = (
|
self.assertFormsetError(response, "inline_admin_formset", None, None, [])
|
||||||
"The formset 'inline_admin_formset' in context 22 does not contain any "
|
|
||||||
"non-form errors."
|
|
||||||
)
|
|
||||||
with self.assertRaisesMessage(AssertionError, msg):
|
|
||||||
self.assertFormsetError(
|
|
||||||
response, "inline_admin_formset", None, None, ["Error"]
|
|
||||||
)
|
|
||||||
|
|
||||||
def test_change_view_form_and_formsets_run_validation(self):
|
def test_change_view_form_and_formsets_run_validation(self):
|
||||||
"""
|
"""
|
||||||
|
|
Loading…
Reference in New Issue