diff --git a/.python-version b/.python-version index 04e20791..251b3507 100644 --- a/.python-version +++ b/.python-version @@ -1 +1 @@ -3.12.8 +3.10.16 diff --git a/tests/api/test_user_info.py b/tests/api/test_user_info.py index 88c7a170..8d780902 100644 --- a/tests/api/test_user_info.py +++ b/tests/api/test_user_info.py @@ -87,6 +87,10 @@ def test_wrong_api_key(flask_client): def test_create_api_key_without_sudo(flask_client): login(flask_client) + # login sets sudo_time in the session; clear it to simulate expired sudo + with flask_client.session_transaction() as sess: + sess.pop("sudo_time", None) + # create api key r = flask_client.post(url_for("api.create_api_key"), json={"device": "Test device"})