def test_populate_errors_when_error_not_match_field(self):
class MyForm(BaseForm):
attribute1 = StringField()
errors = {'attribute2': 'error3'}
with app.test_request_context():
form = MyForm()
form.populate_errors(errors)
assert_that(form, has_properties(attribute1=has_properties(errors=empty())))
assert_that(form, not_(has_property('attribute2')))
评论列表
文章目录