Testing Flask login and authentication?
The problem is different request contexts. In your normal Flask application, each request creates a new context which will be reused through the whole chain until creating the final response and sending it back to the browser. When you create and run Flask tests and execute a request (e.g. self.client.post(…)) the context is discarded after … Read more