summaryrefslogtreecommitdiff
path: root/tests/forms_tests/widget_tests/test_passwordinput.py
diff options
context:
space:
mode:
authorDavid <smithdc@gmail.com>2022-01-13 23:08:38 +0000
committerCarlton Gibson <carlton@noumenal.es>2022-03-30 16:28:14 +0200
commitc8459708a7e0a2474255b77d0f104a7f16e8b32c (patch)
treeadd60b1d21cfaa37e51c116348054e71c91f73a1 /tests/forms_tests/widget_tests/test_passwordinput.py
parent04ad0f26ba4b8c79dc311e1789457e0c4d1b8832 (diff)
Refs #32339 -- Added use_fieldset to Widget.
Diffstat (limited to 'tests/forms_tests/widget_tests/test_passwordinput.py')
-rw-r--r--tests/forms_tests/widget_tests/test_passwordinput.py15
1 files changed, 14 insertions, 1 deletions
diff --git a/tests/forms_tests/widget_tests/test_passwordinput.py b/tests/forms_tests/widget_tests/test_passwordinput.py
index 1adf0cc3cb..82d1a63901 100644
--- a/tests/forms_tests/widget_tests/test_passwordinput.py
+++ b/tests/forms_tests/widget_tests/test_passwordinput.py
@@ -1,4 +1,4 @@
-from django.forms import PasswordInput
+from django.forms import CharField, Form, PasswordInput
from .base import WidgetTest
@@ -37,3 +37,16 @@ class PasswordInputTest(WidgetTest):
"test@example.com",
html='<input type="password" name="password" value="test@example.com">',
)
+
+ 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 type="password" name="field" required id="id_field"></div>',
+ form.render(),
+ )