test_session_interface.py
This file
Path
tests/test_session_interface.py
28 lines · 792 bytes · Python
Last changed by
Merge pull request #4682 from pallets/refactor-context-stackDavid Lordbefore adoptioncbebdae
History of this fileTake it
The walk stopped after 200 commits: lines older than 93a7f08 point at it.
pin os and python version in rtd buildDavid Lordbefore adoption93a7f08
line 1why, one step back1import flaskMerge pull request #4682 from pallets/refactor-context-stackDavid Lordbefore adoptioncbebdae
line 2why, one step back2from flask.globals import request_ctxpin os and python version in rtd buildDavid Lordbefore adoption93a7f08
lines 3–16why, one step back3from flask.sessions import SessionInterface456def test_open_session_with_endpoint():7 """If request.endpoint (or other URL matching behavior) is needed8 while loading the session, RequestContext.match_request() can be9 called manually.10 """1112 class MySessionInterface(SessionInterface):13 def save_session(self, app, session, response):14 pass1516 def open_session(self, app, request):Merge pull request #4682 from pallets/refactor-context-stackDavid Lordbefore adoptioncbebdae
line 17why, one step back17 request_ctx.match_request()pin os and python version in rtd buildDavid Lordbefore adoption93a7f08
lines 18–28why, one step back18 assert request.endpoint is not None1920 app = flask.Flask(__name__)21 app.session_interface = MySessionInterface()2223 @app.get("/")24 def index():25 return "Hello, World!"2627 response = app.test_client().get("/")28 assert response.status_code == 200