Disabling @login_required while unit-testing flask with flask-login
问题 I am unit testing my flask app which uses the flask-login extension. I am setting up all my tests like this using webtest: class TestCase(unittest.TestCase): def setUp(self): app.config['TESTING'] = True self.client = webtest.TestApp(app) But when I try to visit urls through self.client.get() which are decorated with @login_required, I get a 401 error with a message that I am not authorized to access the url. According to the documentation https://flask-login.readthedocs.org/en/latest/