我正在测试我的烧瓶应用程序,它使用flask-login扩展.
我正在使用webtest设置所有我的测试:
class TestCase(unittest.TestCase):
def setUp(self):
app.config['TESTING'] = True
self.client = webtest.TestApp(app)
Run Code Online (Sandbox Code Playgroud)
但是当我尝试通过使用@login_required修饰的self.client.get()访问URL时,我收到401错误,并显示一条消息,表示我无权访问该URL.
根据文档https://flask-login.readthedocs.org/en/latest/#protecting-views 和本讨论,将'TESTING'的配置值设置为True应该禁用登录要求,但这似乎不是为我工作
有什么建议?