MCPcopy
hub / github.com/pallets/werkzeug / test_secure_and_httponly

Method test_secure_and_httponly

tests/test_wrappers.py:1281–1302  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

1279 ]
1280
1281 def test_secure_and_httponly(self):
1282 response = wrappers.Response()
1283 response.set_cookie(
1284 "foo",
1285 value="bar",
1286 max_age=60,
1287 expires=0,
1288 path="/blub",
1289 domain="example.org",
1290 secure=True,
1291 httponly=True,
1292 samesite=None,
1293 )
1294 assert response.headers.to_wsgi_list() == [
1295 ("Content-Type", "text/plain; charset=utf-8"),
1296 (
1297 "Set-Cookie",
1298 "foo=bar; Domain=example.org;"
1299 " Expires=Thu, 01 Jan 1970 00:00:00 GMT; Max-Age=60;"
1300 " Secure; HttpOnly; Path=/blub",
1301 ),
1302 ]
1303
1304 def test_samesite(self):
1305 response = wrappers.Response()

Callers

nothing calls this directly

Calls 2

set_cookieMethod · 0.95
to_wsgi_listMethod · 0.80

Tested by

no test coverage detected