Skip to content

Commit

Permalink
Add test for passthru
Browse files Browse the repository at this point in the history
  • Loading branch information
ahopkins committed Mar 21, 2023
1 parent 0603d40 commit 3f0c8cb
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions tests/test_cookies.py
Original file line number Diff line number Diff line change
Expand Up @@ -499,3 +499,22 @@ def test_cookie_accessor_hyphens():
cookies = CookieRequestParameters({"session-token": ["abc123"]})

assert cookies.get("session-token") == cookies.session_token


def test_cookie_passthru(app):
cookie_jar = None

@app.route("/")
def handler(request):
nonlocal cookie_jar
response = text("OK")
response.add_cookie("one", "1", host_prefix=True)
response.delete_cookie("two", secure_prefix=True)
cookie_jar = response.cookies
return response

_, response = app.test_client.get("/")

assert cookie_jar.get_cookie("two", secure_prefix=True).max_age == 0
assert len(response.cookies) == 1
assert response.cookies["__Host-one"] == "1"

0 comments on commit 3f0c8cb

Please sign in to comment.