mirror of
https://github.com/django/django.git
synced 2025-10-27 07:36:08 +00:00
[1.10.x] Fixed #27037 -- Prevented required attribute on ClearableFileInput when initial data exists.
Backport of fab46ce6f5 from master
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user