1
0
mirror of https://github.com/django/django.git synced 2024-12-23 17:46:27 +00:00
django/tests/forms_tests/widget_tests/test_fileinput.py

17 lines
612 B
Python
Raw Normal View History

from django.forms import FileInput
from .base import WidgetTest
class FileInputTest(WidgetTest):
widget = FileInput()
def test_render(self):
"""
FileInput widgets never render the value attribute. The old value
isn't useful if a form is updated or an error occurred.
"""
self.check_html(self.widget, 'email', 'test@example.com', html='<input type="file" name="email" />')
self.check_html(self.widget, 'email', '', html='<input type="file" name="email" />')
self.check_html(self.widget, 'email', None, html='<input type="file" name="email" />')