Fixed #27037 -- Prevented required attribute on ClearableFileInput when initial data exists.

This commit is contained in:
Jon Dufresne 2016-08-12 10:59:01 -07:00 committed by Tim Graham
parent f842d1011c
commit fab46ce6f5
8 changed files with 66 additions and 18 deletions

View file

@ -8,3 +8,10 @@ class HiddenInputTest(WidgetTest):
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)