def test_to_dict_with_formfield(self):
class SubMyForm(BaseForm):
subattribute = StringField()
class MyForm(BaseForm):
attribute = FormField(SubMyForm)
with app.test_request_context(method='POST', data={'attribute-subattribute': 'subvalue'}):
form = MyForm()
result = form.to_dict()
assert_that(result, has_entries(attribute=has_entries(subattribute='subvalue')))
评论列表
文章目录