summaryrefslogtreecommitdiff
path: root/tests/forms_tests/widget_tests/test_fileinput.py
blob: eb1c9d81ed2e07db4524603ce5ad3302aab5f436 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
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" />')