Skip to content

Commit

Permalink
Test session id not rotating on every request
Browse files Browse the repository at this point in the history
  • Loading branch information
stveit committed Feb 23, 2024
1 parent ce92ff7 commit e74a7c8
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions tests/integration/web/webfront_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit e74a7c8

Please sign in to comment.