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()
评论列表
文章目录