mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-09-08 08:28:15 -04:00
notify-api-412 use black to enforce python coding style
This commit is contained in:
@@ -5,28 +5,34 @@ from app.main.forms import StripWhitespaceForm, StripWhitespaceStringField
|
||||
|
||||
|
||||
class ExampleForm(StripWhitespaceForm):
|
||||
foo = StringField('Foo')
|
||||
foo = StringField("Foo")
|
||||
|
||||
|
||||
class ExampleFormSpecialField(Form):
|
||||
foo = StripWhitespaceStringField('foo')
|
||||
foo = StripWhitespaceStringField("foo")
|
||||
|
||||
|
||||
@pytest.mark.parametrize('submitted_data', [
|
||||
'bar',
|
||||
' bar ',
|
||||
"""
|
||||
@pytest.mark.parametrize(
|
||||
"submitted_data",
|
||||
[
|
||||
"bar",
|
||||
" bar ",
|
||||
"""
|
||||
\t bar
|
||||
""",
|
||||
' \u180E\u200B \u200C bar \u200D \u2060\uFEFF ',
|
||||
])
|
||||
@pytest.mark.parametrize('form', [
|
||||
ExampleForm,
|
||||
ExampleFormSpecialField,
|
||||
])
|
||||
" \u180E\u200B \u200C bar \u200D \u2060\uFEFF ",
|
||||
],
|
||||
)
|
||||
@pytest.mark.parametrize(
|
||||
"form",
|
||||
[
|
||||
ExampleForm,
|
||||
ExampleFormSpecialField,
|
||||
],
|
||||
)
|
||||
def test_form_strips_all_whitespace(
|
||||
notify_admin,
|
||||
form,
|
||||
submitted_data,
|
||||
):
|
||||
assert form(foo=submitted_data).foo.data == 'bar'
|
||||
assert form(foo=submitted_data).foo.data == "bar"
|
||||
|
||||
Reference in New Issue
Block a user