1
0
mirror of https://github.com/django/django.git synced 2025-10-24 06:06:09 +00:00

Refs #32339 -- Added use_fieldset to Widget.

This commit is contained in:
David
2022-01-13 23:08:38 +00:00
committed by Carlton Gibson
parent 04ad0f26ba
commit c8459708a7
28 changed files with 489 additions and 22 deletions

View File

@@ -1,4 +1,4 @@
from django.forms import Textarea
from django.forms import CharField, Form, Textarea
from django.utils.safestring import mark_safe
from .base import WidgetTest
@@ -62,3 +62,17 @@ class TextareaTest(WidgetTest):
"</textarea>"
),
)
def test_fieldset(self):
class TestForm(Form):
template_name = "forms_tests/use_fieldset.html"
field = CharField(widget=self.widget)
form = TestForm()
self.assertIs(self.widget.use_fieldset, False)
self.assertHTMLEqual(
'<div><label for="id_field">Field:</label>'
'<textarea cols="40" id="id_field" name="field" '
'required rows="10"></textarea></div>',
form.render(),
)