Add regression test for session membership vary header
This commit is contained in:
parent
58c4c61b71
commit
cf9491e3da
1 changed files with 18 additions and 0 deletions
18
tests/test_session_access.py
Normal file
18
tests/test_session_access.py
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
from flask import Flask, session
|
||||
|
||||
|
||||
def test_session_contains_sets_vary_cookie():
|
||||
app = Flask(__name__)
|
||||
app.secret_key = "secret"
|
||||
|
||||
@app.route("/")
|
||||
def index():
|
||||
"user_id" in session
|
||||
return "ok"
|
||||
|
||||
client = app.test_client()
|
||||
response = client.get("/")
|
||||
|
||||
assert response.status_code == 200
|
||||
assert "Vary" in response.headers
|
||||
assert "Cookie" in response.headers["Vary"]
|
||||
Loading…
Add table
Add a link
Reference in a new issue