mirror of
https://github.com/django/django.git
synced 2025-11-24 21:00:12 +00:00
Refs #32339 -- Added use_fieldset to Widget.
This commit is contained in:
parent
04ad0f26ba
commit
c8459708a7
28 changed files with 489 additions and 22 deletions
|
|
@ -1,6 +1,6 @@
|
|||
from datetime import datetime
|
||||
|
||||
from django.forms import DateTimeInput
|
||||
from django.forms import CharField, DateTimeInput, Form
|
||||
from django.test import ignore_warnings
|
||||
from django.utils import translation
|
||||
from django.utils.deprecation import RemovedInDjango50Warning
|
||||
|
|
@ -97,3 +97,16 @@ class DateTimeInputTest(WidgetTest):
|
|||
d,
|
||||
html='<input type="text" name="date" value="17/09/2007 12:51:34">',
|
||||
)
|
||||
|
||||
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>'
|
||||
'<input id="id_field" name="field" required type="text"></div>',
|
||||
form.render(),
|
||||
)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue