Commit 2b99ddbf authored by Carlton Gibson's avatar Carlton Gibson
Browse files

[4.1.x] Fixed #33876, Refs #32229 -- Made management forms render with div.html template.

parent 082a2c35df7f
......@@ -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)
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment