1
0
mirror of https://github.com/django/django.git synced 2025-10-24 22:26:08 +00:00

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

@@ -76,3 +76,9 @@ class TextInputTest(WidgetTest):
def test_attrs_safestring(self):
widget = TextInput(attrs={'onBlur': mark_safe("function('foo')")})
self.check_html(widget, 'email', '', html='<input onBlur="function(\'foo\')" type="text" name="email" />')
def test_use_required_attribute(self):
# Text inputs can safely trigger the browser validation.
self.assertIs(self.widget.use_required_attribute(None), True)
self.assertIs(self.widget.use_required_attribute(''), True)
self.assertIs(self.widget.use_required_attribute('resume.txt'), True)