test_classful.py 文件源码

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

项目:wazo-admin-ui 作者: wazo-pbx 项目源码 文件源码
def setUp(self):
        self.view = BaseView()
        ErrorExtractor.generic_patterns = GENERIC_PATTERN_ERRORS
        ErrorExtractor.specific_patterns = SPECIFIC_PATTERN_ERRORS
        ErrorExtractor.url_to_name_resources = URL_TO_NAME_RESOURCES
        ErrorTranslator.generic_messages = GENERIC_MESSAGE_ERRORS
        ErrorTranslator.specific_messages = SPECIFIC_MESSAGE_ERRORS
        app.config['TESTING'] = True
        app.config['WTF_CSRF_ENABLED'] = False

        class MyForm(BaseForm):
            attribute1 = StringField()

        with app.test_request_context(method='POST', data={'attribute1': ''}):
            self.form = MyForm()
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号