summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--django/test/testcases.py9
-rw-r--r--docs/releases/5.1.txt2
-rw-r--r--docs/topics/testing/tools.txt5
-rw-r--r--tests/test_utils/tests.py9
4 files changed, 2 insertions, 23 deletions
diff --git a/django/test/testcases.py b/django/test/testcases.py
index ac1996d97b..a39a38a7d5 100644
--- a/django/test/testcases.py
+++ b/django/test/testcases.py
@@ -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.
diff --git a/docs/releases/5.1.txt b/docs/releases/5.1.txt
index a1825a7954..c3b2a737fa 100644
--- a/docs/releases/5.1.txt
+++ b/docs/releases/5.1.txt
@@ -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.
diff --git a/docs/topics/testing/tools.txt b/docs/topics/testing/tools.txt
index e9b12d94f0..7190c73d79 100644
--- a/docs/topics/testing/tools.txt
+++ b/docs/topics/testing/tools.txt
@@ -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
diff --git a/tests/test_utils/tests.py b/tests/test_utils/tests.py
index cdb0453e44..ef72fb9fdb 100644
--- a/tests/test_utils/tests.py
+++ b/tests/test_utils/tests.py
@@ -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")