test_session_cookie_setting() — flask Function Reference
Architecture documentation for the test_session_cookie_setting() function in test_basic.py from the flask codebase.
Entity Profile
Dependency Diagram
graph TD c50ef6a2_8102_fc96_3887_29e9d175b0c6["test_session_cookie_setting()"] 85bc4fb5_d1d7_a135_020d_69e052c12c0f["test_basic.py"] c50ef6a2_8102_fc96_3887_29e9d175b0c6 -->|defined in| 85bc4fb5_d1d7_a135_020d_69e052c12c0f style c50ef6a2_8102_fc96_3887_29e9d175b0c6 fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
tests/test_basic.py lines 479–517
def test_session_cookie_setting(app):
is_permanent = True
@app.route("/bump")
def bump():
rv = flask.session["foo"] = flask.session.get("foo", 0) + 1
flask.session.permanent = is_permanent
return str(rv)
@app.route("/read")
def read():
return str(flask.session.get("foo", 0))
def run_test(expect_header):
with app.test_client() as c:
assert c.get("/bump").data == b"1"
assert c.get("/bump").data == b"2"
assert c.get("/bump").data == b"3"
rv = c.get("/read")
set_cookie = rv.headers.get("set-cookie")
assert (set_cookie is not None) == expect_header
assert rv.data == b"3"
is_permanent = True
app.config["SESSION_REFRESH_EACH_REQUEST"] = True
run_test(expect_header=True)
is_permanent = True
app.config["SESSION_REFRESH_EACH_REQUEST"] = False
run_test(expect_header=False)
is_permanent = False
app.config["SESSION_REFRESH_EACH_REQUEST"] = True
run_test(expect_header=False)
is_permanent = False
app.config["SESSION_REFRESH_EACH_REQUEST"] = False
run_test(expect_header=False)
Domain
Subdomains
Defined In
Source
Frequently Asked Questions
What does test_session_cookie_setting() do?
test_session_cookie_setting() is a function in the flask codebase, defined in tests/test_basic.py.
Where is test_session_cookie_setting() defined?
test_session_cookie_setting() is defined in tests/test_basic.py at line 479.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free