Thanks to Claude Paroz for the report.
Backport of 89e695a69b
from main
This commit is contained in:
parent
bdff4d5b3a
commit
8aab03ab55
|
@ -32,6 +32,8 @@ class ManagementForm(Form):
|
|||
as well.
|
||||
"""
|
||||
|
||||
template_name = "django/forms/div.html" # RemovedInDjango50Warning.
|
||||
|
||||
TOTAL_FORMS = IntegerField(widget=HiddenInput)
|
||||
INITIAL_FORMS = IntegerField(widget=HiddenInput)
|
||||
# MIN_NUM_FORM_COUNT and MAX_NUM_FORM_COUNT are output with the rest of the
|
||||
|
|
|
@ -1910,3 +1910,14 @@ class DeprecationTests(SimpleTestCase):
|
|||
ChoiceFormSet = formset_factory(Choice)
|
||||
formset = ChoiceFormSet()
|
||||
str(formset)
|
||||
|
||||
def test_no_management_form_warning(self):
|
||||
"""
|
||||
Management forms are already rendered with the new div template.
|
||||
"""
|
||||
with isolate_lru_cache(get_default_renderer), self.settings(
|
||||
FORM_RENDERER="django.forms.renderers.DjangoTemplates"
|
||||
):
|
||||
ChoiceFormSet = formset_factory(Choice, formset=BaseFormSet)
|
||||
formset = ChoiceFormSet()
|
||||
str(formset.management_form)
|
||||
|
|
Loading…
Reference in New Issue