# 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 decimal import Decimal
from decimal import ROUND_DOWN
from decimal import ROUND_UP
from tests.common import DummyPostData
from wtforms.fields import DecimalField
from wtforms.form import Form




def make_form(name="F", **fields):
    return type(str(name), (Form,), fields)


def test_decimal_field():
    F = make_form(a=DecimalField())

# 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_decimal.py
from decimal import Decimal
from decimal import ROUND_DOWN
from decimal import ROUND_UP
from tests.common import DummyPostData
from wtforms.fields import DecimalField
from wtforms.form import Form





def make_form(name="F", **fields):
    return type(str(name), (Form,), fields)


def test_decimal_field():
    F = make_form(a=DecimalField())

    form = F(DummyPostData(a="2.1"))