1
0
mirror of https://github.com/django/django.git synced 2025-10-31 09:41:08 +00:00

Refs #33348 -- Removed support for passing errors=None to SimpleTestCase.assertFormError()/assertFormsetErrors().

Per deprecation timeline.
This commit is contained in:
Mariusz Felisiak
2023-01-12 14:32:00 +01:00
parent 23ec318988
commit 23c8787439
3 changed files with 3 additions and 52 deletions

View File

@@ -724,15 +724,6 @@ class SimpleTestCase(unittest.TestCase):
You can pass field=None to check the form's non-field errors.
"""
if errors is None:
warnings.warn(
"Passing errors=None to assertFormError() is deprecated, use "
"errors=[] instead.",
RemovedInDjango50Warning,
stacklevel=2,
)
errors = []
if msg_prefix:
msg_prefix += ": "
errors = to_list(errors)
@@ -760,15 +751,6 @@ class SimpleTestCase(unittest.TestCase):
Other parameters are the same as assertFormError().
"""
if errors is None:
warnings.warn(
"Passing errors=None to assertFormSetError() is deprecated, "
"use errors=[] instead.",
RemovedInDjango50Warning,
stacklevel=2,
)
errors = []
if form_index is None and field is not None:
raise ValueError("You must use field=None with form_index=None.")