Remove unused form fields

This commit is contained in:
Patrick Smith
2019-02-22 11:26:20 -05:00
parent b778942dd7
commit f614a3ff83
2 changed files with 2 additions and 69 deletions

View File

@@ -4,41 +4,7 @@ from wtforms.fields import StringField
import pendulum
from werkzeug.datastructures import ImmutableMultiDict
from atst.forms.fields import NewlineListField, FormFieldWrapper
class NewlineListForm(Form):
newline_list = NewlineListField()
@pytest.mark.parametrize(
"input_,expected",
[
("", []),
("hello", ["hello"]),
("hello\n", ["hello"]),
("hello\nworld", ["hello", "world"]),
("hello\nworld\n", ["hello", "world"]),
],
)
def test_newline_list_process(input_, expected):
form_data = ImmutableMultiDict({"newline_list": input_})
form = NewlineListForm(form_data)
assert form.validate()
assert form.data == {"newline_list": expected}
@pytest.mark.parametrize(
"input_,expected",
[([], ""), (["hello"], "hello"), (["hello", "world"], "hello\nworld")],
)
def test_newline_list_value(input_, expected):
form_data = {"newline_list": input_}
form = NewlineListForm(data=form_data)
assert form.validate()
assert form.newline_list._value() == expected
from atst.forms.fields import FormFieldWrapper
class PersonForm(Form):