title: Fire multiple requests in a flask test request context
body: <p>I'm currently writing unit tests for a flask app that requires a session to be kept open during the test. For this I found out I can use <code>test_request_context</code>. This works fine until I need to make multiple requests.</p>
  
  <p>My current test deals with a login/logout system and I need to ensure that certain properties are actually reset from the session when the user clicks the logout button. </p>
  
  <p>A rough example of my code:</p>
  
  <pre><code>from unittest import TestCase
  from flask import Flask, session
  from mypackage import auth_blueprint
  
  
  class FlaskTestCase(TestCase):
      def setUp(self):
          self.app = Flask(__name__)
          self.app.secret_key = urandom(24)
          self.app.register_blueprint(auth_blueprint)   # The blueprint to test
          self.client = self.app.test_client()
  
      def test_login_logout():
          with self.app.test_request_context("/auth/login", data={"username": "foo", "password": "bar"}, method="POST"):
              assert session["logged_in"]
              # How would I make A call to logout?
              # self.client.post("/auth/logout") doesn't work
              assert not session["logged_in"]
  </code></pre>
  
  <p>Does anyone know how I could make multiple calls and inspect the same session in one test? Thanks for the help in advance</p>