1
0
mirror of https://github.com/django/django.git synced 2025-10-24 06:06:09 +00:00

Fixed #33830 -- Fixed VariableDoesNotExist when rendering ClearableFileInput.

This commit is contained in:
Neeraj Kumar
2022-08-24 14:35:01 +05:30
committed by Mariusz Felisiak
parent 6f49b7b69b
commit 9942f3fb49
2 changed files with 11 additions and 0 deletions

View File

@@ -110,6 +110,16 @@ class ClearableFileInputTest(WidgetTest):
),
)
def test_render_no_disabled(self):
class TestForm(Form):
clearable_file = FileField(
widget=self.widget, initial=FakeFieldFile(), required=False
)
form = TestForm()
with self.assertNoLogs("django.template", "DEBUG"):
form.render()
def test_render_as_subwidget(self):
"""A ClearableFileInput as a subwidget of MultiWidget."""
widget = MultiWidget(widgets=(self.widget,))