From e74a7c8aa45b86fe32fb24899b175c877e417f47 Mon Sep 17 00:00:00 2001 From: Simon Oliver Tveit Date: Thu, 22 Feb 2024 11:30:44 +0100 Subject: [PATCH] Test session id not rotating on every request --- tests/integration/web/webfront_test.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/tests/integration/web/webfront_test.py b/tests/integration/web/webfront_test.py index 20a9c081b4..a7749ec878 100644 --- a/tests/integration/web/webfront_test.py +++ b/tests/integration/web/webfront_test.py @@ -78,3 +78,13 @@ def test_session_id_is_changed_after_logging_in(db, client, admin_account): ) session_id_post_login = client.session.session_key assert session_id_post_login != session_id_pre_login + + +def test_session_id_is_not_changed_after_request_unrelated_to_login(db, client): + index_url = reverse('webfront-index') + # make sure we have a session ID we can use for comparison + assert client.session.session_key + session_id_pre_login = client.session.session_key + client.get(index_url) + session_id_post_login = client.session.session_key + assert session_id_post_login == session_id_pre_login