mirror of https://github.com/django/django.git
Refs #33990 -- Removed SimpleTestCase.assertFormsetError() per deprecation timeline.
This commit is contained in:
parent
7433237664
commit
c35fd9e275
|
@ -601,15 +601,6 @@ class SimpleTestCase(unittest.TestCase):
|
|||
errors = to_list(errors)
|
||||
self._assert_form_error(form, field, errors, msg_prefix, f"form {form!r}")
|
||||
|
||||
# RemovedInDjango51Warning.
|
||||
def assertFormsetError(self, *args, **kw):
|
||||
warnings.warn(
|
||||
"assertFormsetError() is deprecated in favor of assertFormSetError().",
|
||||
category=RemovedInDjango51Warning,
|
||||
stacklevel=2,
|
||||
)
|
||||
return self.assertFormSetError(*args, **kw)
|
||||
|
||||
def assertFormSetError(self, formset, form_index, field, errors, msg_prefix=""):
|
||||
"""
|
||||
Similar to assertFormError() but for formsets.
|
||||
|
|
|
@ -270,3 +270,5 @@ to remove usage of these features.
|
|||
|
||||
* The ``map_width`` and ``map_height`` attributes of ``BaseGeometryWidget`` are
|
||||
removed.
|
||||
|
||||
* The ``SimpleTestCase.assertFormsetError()`` method is removed.
|
||||
|
|
|
@ -1681,11 +1681,6 @@ your test suite.
|
|||
``field`` and ``errors`` have the same meaning as the parameters to
|
||||
``assertFormError()``.
|
||||
|
||||
.. deprecated:: 4.2
|
||||
|
||||
The ``assertFormsetError()`` assertion method is deprecated. Use
|
||||
``assertFormSetError()`` instead.
|
||||
|
||||
.. method:: SimpleTestCase.assertContains(response, text, count=None, status_code=200, msg_prefix='', html=False)
|
||||
|
||||
Asserts that a :class:`response <django.http.HttpResponse>` produced the
|
||||
|
|
|
@ -1425,15 +1425,6 @@ class AssertFormErrorTests(SimpleTestCase):
|
|||
|
||||
|
||||
class AssertFormSetErrorTests(SimpleTestCase):
|
||||
def test_rename_assertformseterror_deprecation_warning(self):
|
||||
msg = "assertFormsetError() is deprecated in favor of assertFormSetError()."
|
||||
with self.assertRaisesMessage(RemovedInDjango51Warning, msg):
|
||||
self.assertFormsetError()
|
||||
|
||||
@ignore_warnings(category=RemovedInDjango51Warning)
|
||||
def test_deprecated_assertformseterror(self):
|
||||
self.assertFormsetError(TestFormset.invalid(), 0, "field", "invalid value")
|
||||
|
||||
def test_single_error(self):
|
||||
self.assertFormSetError(TestFormset.invalid(), 0, "field", "invalid value")
|
||||
|
||||
|
|
Loading…
Reference in New Issue