diff options
| author | Carles Pina <carles@pina.cat> | 2020-05-04 17:41:38 +0200 |
|---|---|---|
| committer | Mariusz Felisiak <felisiak.mariusz@gmail.com> | 2020-06-01 12:25:25 +0200 |
| commit | e46c2326c8cfc038e015f55fd050ab5d7eb91b62 (patch) | |
| tree | 717bae6135483bfeb4061fc90932f8ad52519f43 /tests/forms_tests/widget_tests/test_clearablefileinput.py | |
| parent | 578b3046e3b4adc43655bb5dd955054b7bf19f89 (diff) | |
Fixed #31536 -- Fixed rendering of disabled AdminFileWidget and ClearableFileInput.
Diffstat (limited to 'tests/forms_tests/widget_tests/test_clearablefileinput.py')
| -rw-r--r-- | tests/forms_tests/widget_tests/test_clearablefileinput.py | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/tests/forms_tests/widget_tests/test_clearablefileinput.py b/tests/forms_tests/widget_tests/test_clearablefileinput.py index fabf71934f..dee44c4239 100644 --- a/tests/forms_tests/widget_tests/test_clearablefileinput.py +++ b/tests/forms_tests/widget_tests/test_clearablefileinput.py @@ -74,6 +74,21 @@ class ClearableFileInputTest(WidgetTest): """ self.check_html(self.widget, 'myfile', None, html='<input type="file" name="myfile">') + def test_render_disabled(self): + self.check_html( + self.widget, + 'myfile', + FakeFieldFile(), + attrs={'disabled': True}, + html=( + 'Currently: <a href="something">something</a>' + '<input type="checkbox" name="myfile-clear" ' + 'id="myfile-clear_id" disabled>' + '<label for="myfile-clear_id">Clear</label><br>' + 'Change: <input type="file" name="myfile" disabled>' + ), + ) + def test_render_as_subwidget(self): """A ClearableFileInput as a subwidget of MultiWidget.""" widget = MultiWidget(widgets=(self.widget,)) |
