mirror of
https://github.com/django/django.git
synced 2025-10-24 06:06:09 +00:00
Fixed #31118 -- Made FileInput to avoid the required attribute when initial data exists.
This commit is contained in:
committed by
Mariusz Felisiak
parent
53d8646f79
commit
ffcf1a8ebf
@@ -18,3 +18,9 @@ class FileInputTest(WidgetTest):
|
||||
def test_value_omitted_from_data(self):
|
||||
self.assertIs(self.widget.value_omitted_from_data({}, {}, 'field'), True)
|
||||
self.assertIs(self.widget.value_omitted_from_data({}, {'field': 'value'}, 'field'), False)
|
||||
|
||||
def test_use_required_attribute(self):
|
||||
# False when initial data exists. The file input is left blank by the
|
||||
# user to keep the existing, initial value.
|
||||
self.assertIs(self.widget.use_required_attribute(None), True)
|
||||
self.assertIs(self.widget.use_required_attribute('resume.txt'), False)
|
||||
|
||||
Reference in New Issue
Block a user