Update tests for the latest changes.
This commit is contained in:
+3
-8
@@ -39,7 +39,6 @@ from paskia.db.operations import DB
|
|||||||
from paskia.fastapi.mainapp import app
|
from paskia.fastapi.mainapp import app
|
||||||
from paskia.fastapi.session import AUTH_COOKIE_NAME
|
from paskia.fastapi.session import AUTH_COOKIE_NAME
|
||||||
from paskia.sansio import Passkey
|
from paskia.sansio import Passkey
|
||||||
from paskia.util.passphrase import generate
|
|
||||||
|
|
||||||
|
|
||||||
@pytest.fixture(scope="session")
|
@pytest.fixture(scope="session")
|
||||||
@@ -181,7 +180,7 @@ async def session_token(
|
|||||||
return create_session(
|
return create_session(
|
||||||
user_uuid=test_user.uuid,
|
user_uuid=test_user.uuid,
|
||||||
credential_uuid=test_credential.uuid,
|
credential_uuid=test_credential.uuid,
|
||||||
host="localhost:4401",
|
host="localhost",
|
||||||
ip="127.0.0.1",
|
ip="127.0.0.1",
|
||||||
user_agent="pytest",
|
user_agent="pytest",
|
||||||
expiry=expires(),
|
expiry=expires(),
|
||||||
@@ -196,7 +195,7 @@ async def regular_session_token(
|
|||||||
return create_session(
|
return create_session(
|
||||||
user_uuid=regular_user.uuid,
|
user_uuid=regular_user.uuid,
|
||||||
credential_uuid=regular_credential.uuid,
|
credential_uuid=regular_credential.uuid,
|
||||||
host="localhost:4401",
|
host="localhost",
|
||||||
ip="127.0.0.1",
|
ip="127.0.0.1",
|
||||||
user_agent="pytest",
|
user_agent="pytest",
|
||||||
expiry=expires(),
|
expiry=expires(),
|
||||||
@@ -206,15 +205,11 @@ async def regular_session_token(
|
|||||||
@pytest_asyncio.fixture(scope="function")
|
@pytest_asyncio.fixture(scope="function")
|
||||||
async def reset_token(test_db: DB, test_user: User, test_credential: Credential) -> str:
|
async def reset_token(test_db: DB, test_user: User, test_credential: Credential) -> str:
|
||||||
"""Create a reset token for the test user."""
|
"""Create a reset token for the test user."""
|
||||||
|
return create_reset_token(
|
||||||
token = generate()
|
|
||||||
create_reset_token(
|
|
||||||
user_uuid=test_user.uuid,
|
user_uuid=test_user.uuid,
|
||||||
passphrase=token,
|
|
||||||
expiry=reset_expires(),
|
expiry=reset_expires(),
|
||||||
token_type="reset",
|
token_type="reset",
|
||||||
)
|
)
|
||||||
return token
|
|
||||||
|
|
||||||
|
|
||||||
@pytest_asyncio.fixture(scope="function")
|
@pytest_asyncio.fixture(scope="function")
|
||||||
|
|||||||
+2
-2
@@ -101,7 +101,7 @@ async def second_org_session_token(
|
|||||||
return create_session(
|
return create_session(
|
||||||
user_uuid=second_org_user.uuid,
|
user_uuid=second_org_user.uuid,
|
||||||
credential_uuid=second_org_credential.uuid,
|
credential_uuid=second_org_credential.uuid,
|
||||||
host="localhost:4401",
|
host="localhost",
|
||||||
ip="127.0.0.1",
|
ip="127.0.0.1",
|
||||||
user_agent="pytest",
|
user_agent="pytest",
|
||||||
expiry=expires(),
|
expiry=expires(),
|
||||||
@@ -158,7 +158,7 @@ async def org_admin_session_token(
|
|||||||
return create_session(
|
return create_session(
|
||||||
user_uuid=org_admin_user.uuid,
|
user_uuid=org_admin_user.uuid,
|
||||||
credential_uuid=org_admin_credential.uuid,
|
credential_uuid=org_admin_credential.uuid,
|
||||||
host="localhost:4401",
|
host="localhost",
|
||||||
ip="127.0.0.1",
|
ip="127.0.0.1",
|
||||||
user_agent="pytest",
|
user_agent="pytest",
|
||||||
expiry=expires(),
|
expiry=expires(),
|
||||||
|
|||||||
+1
-1
@@ -526,7 +526,7 @@ class TestValidateSessionRefresh:
|
|||||||
token = create_session(
|
token = create_session(
|
||||||
user_uuid=test_user.uuid,
|
user_uuid=test_user.uuid,
|
||||||
credential_uuid=test_credential.uuid,
|
credential_uuid=test_credential.uuid,
|
||||||
host="localhost:4401",
|
host="localhost",
|
||||||
ip="127.0.0.1",
|
ip="127.0.0.1",
|
||||||
user_agent="pytest",
|
user_agent="pytest",
|
||||||
expiry=old_expiry,
|
expiry=old_expiry,
|
||||||
|
|||||||
Reference in New Issue
Block a user