diff --git a/src/pypnusershub/tests/test_utils.py b/src/pypnusershub/tests/test_utils.py index 39de8e2..5f66af4 100644 --- a/src/pypnusershub/tests/test_utils.py +++ b/src/pypnusershub/tests/test_utils.py @@ -4,7 +4,9 @@ from flask import Response from werkzeug.http import parse_cookie -from pypnusershub.utils import get_cookie_path, set_cookie +from pypnusershub.utils import get_cookie_path, set_cookie, delete_cookie + +from .utils import set_logged_user_cookie class TestUtils: @@ -39,3 +41,11 @@ def test_set_cookie(self): assert cookie_attrs[key] == value assert cookie_attrs["Path"] == "/geonature" assert cookie_attrs["Expires"] != "" + + logout_response = delete_cookie(response, key=key, application_url=application_url) + cookie = logout_response.headers.getlist("Set-Cookie")[1] + cookie_attrs = parse_cookie(cookie) + + assert cookie_attrs[key] == "" + assert cookie_attrs["Path"] == "/geonature" + assert True