2015-08-31 02:13:42 +00:00
|
|
|
from django.forms import HiddenInput
|
|
|
|
|
|
|
|
from .base import WidgetTest
|
|
|
|
|
|
|
|
|
|
|
|
class HiddenInputTest(WidgetTest):
|
|
|
|
widget = HiddenInput()
|
|
|
|
|
|
|
|
def test_render(self):
|
2018-01-21 07:09:10 +00:00
|
|
|
self.check_html(self.widget, 'email', '', html='<input type="hidden" name="email">')
|
2016-08-12 17:59:01 +00:00
|
|
|
|
|
|
|
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)
|