def test_to_dict_with_csrf_token(self):
class MyForm(BaseForm):
attribute1 = StringField()
csrf_token = StringField()
with app.test_request_context(method='POST', data={'attribute1': 'value',
'csrf_token': '123-abcd'}):
form = MyForm()
result = form.to_dict()
assert_that(result, has_entries(attribute1='value'))
评论列表
文章目录