# Path: tests/common.py
# class DummyPostData(dict):
#     def getlist(self, key):
#         v = self[key]
#         if not isinstance(v, (list, tuple)):
#             v = [v]
#         return v


from tests.common import DummyPostData
from wtforms.fields import FileField
from wtforms.fields import MultipleFileField
from wtforms.form import Form
from wtforms.widgets import TextInput



def test_file_field():
    class F(Form):
        file = FileField()


# Path: tests/common.py
# class DummyPostData(dict):
#     def getlist(self, key):
#         v = self[key]
#         if not isinstance(v, (list, tuple)):
#             v = [v]
#         return v


# Path: tests/fields/test_file.py
from tests.common import DummyPostData
from wtforms.fields import FileField
from wtforms.fields import MultipleFileField
from wtforms.form import Form
from wtforms.widgets import TextInput




def test_file_field():
    class F(Form):
        file = FileField()


    assert F(DummyPostData(file=["test.txt"])).file.data == "test.txt"