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