From 250189dbe5e32e6869f67e1f2bdd7bd94df1cbc5 Mon Sep 17 00:00:00 2001 From: Leo Vasanko Date: Thu, 5 Feb 2026 19:26:20 +0000 Subject: [PATCH] Update tests for the latest changes. --- tests/conftest.py | 11 +++-------- tests/test_admin.py | 4 ++-- tests/test_api.py | 2 +- 3 files changed, 6 insertions(+), 11 deletions(-) diff --git a/tests/conftest.py b/tests/conftest.py index bfad488..6890b89 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -39,7 +39,6 @@ from paskia.db.operations import DB from paskia.fastapi.mainapp import app from paskia.fastapi.session import AUTH_COOKIE_NAME from paskia.sansio import Passkey -from paskia.util.passphrase import generate @pytest.fixture(scope="session") @@ -181,7 +180,7 @@ async def session_token( return create_session( user_uuid=test_user.uuid, credential_uuid=test_credential.uuid, - host="localhost:4401", + host="localhost", ip="127.0.0.1", user_agent="pytest", expiry=expires(), @@ -196,7 +195,7 @@ async def regular_session_token( return create_session( user_uuid=regular_user.uuid, credential_uuid=regular_credential.uuid, - host="localhost:4401", + host="localhost", ip="127.0.0.1", user_agent="pytest", expiry=expires(), @@ -206,15 +205,11 @@ async def regular_session_token( @pytest_asyncio.fixture(scope="function") async def reset_token(test_db: DB, test_user: User, test_credential: Credential) -> str: """Create a reset token for the test user.""" - - token = generate() - create_reset_token( + return create_reset_token( user_uuid=test_user.uuid, - passphrase=token, expiry=reset_expires(), token_type="reset", ) - return token @pytest_asyncio.fixture(scope="function") diff --git a/tests/test_admin.py b/tests/test_admin.py index f0c7215..724ca6d 100644 --- a/tests/test_admin.py +++ b/tests/test_admin.py @@ -101,7 +101,7 @@ async def second_org_session_token( return create_session( user_uuid=second_org_user.uuid, credential_uuid=second_org_credential.uuid, - host="localhost:4401", + host="localhost", ip="127.0.0.1", user_agent="pytest", expiry=expires(), @@ -158,7 +158,7 @@ async def org_admin_session_token( return create_session( user_uuid=org_admin_user.uuid, credential_uuid=org_admin_credential.uuid, - host="localhost:4401", + host="localhost", ip="127.0.0.1", user_agent="pytest", expiry=expires(), diff --git a/tests/test_api.py b/tests/test_api.py index 92ca9f9..edf5984 100644 --- a/tests/test_api.py +++ b/tests/test_api.py @@ -526,7 +526,7 @@ class TestValidateSessionRefresh: token = create_session( user_uuid=test_user.uuid, credential_uuid=test_credential.uuid, - host="localhost:4401", + host="localhost", ip="127.0.0.1", user_agent="pytest", expiry=old_expiry,