# 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 StringField
from wtforms.form import Form



class F(Form):
    a = StringField()


def test_string_field():
    form = F()
    assert form.a.data is None
    assert form.a() == """<input id="a" name="a" type="text" value="">"""

# 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_string.py
from tests.common import DummyPostData
from wtforms.fields import StringField
from wtforms.form import Form




class F(Form):
    a = StringField()


def test_string_field():
    form = F()
    assert form.a.data is None
    assert form.a() == """<input id="a" name="a" type="text" value="">"""

    form = F(DummyPostData(a=["hello"]))