mirror of
https://github.com/django/django.git
synced 2024-11-18 07:26:04 +00:00
18 lines
601 B
Python
18 lines
601 B
Python
from django.forms import HiddenInput
|
|
|
|
from .base import WidgetTest
|
|
|
|
|
|
class HiddenInputTest(WidgetTest):
|
|
widget = HiddenInput()
|
|
|
|
def test_render(self):
|
|
self.check_html(self.widget, 'email', '', html='<input type="hidden" name="email">')
|
|
|
|
def test_use_required_attribute(self):
|
|
# Always False to avoid browser validation on inputs hidden from the
|
|
# user.
|
|
self.assertIs(self.widget.use_required_attribute(None), False)
|
|
self.assertIs(self.widget.use_required_attribute(''), False)
|
|
self.assertIs(self.widget.use_required_attribute('foo'), False)
|