Files
CTFd/tests/utils/test_sessions.py
2019-01-08 02:52:51 -05:00

22 lines
580 B
Python

from tests.helpers import *
def test_sessions_set_httponly():
app = create_ctfd()
with app.app_context():
with app.test_client() as client:
r = client.get('/')
cookie = dict(r.headers)['Set-Cookie']
assert 'HttpOnly;' in cookie
destroy_ctfd(app)
def test_sessions_set_samesite():
app = create_ctfd()
with app.app_context():
with app.test_client() as client:
r = client.get('/')
cookie = dict(r.headers)['Set-Cookie']
assert 'SameSite=' in cookie
destroy_ctfd(app)