test_form.py 文件源码

python
阅读 17 收藏 0 点赞 0 评论 0

项目:wazo-admin-ui 作者: wazo-pbx 项目源码 文件源码
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')))
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号