Phase 3: Appointment model & booking API with timezone fix

This commit is contained in:
counterweight 2025-12-21 00:03:34 +01:00
parent f6cf093cb1
commit 06817875f7
Signed by: counterweight
GPG key ID: 883EDBAA726BD96C
9 changed files with 946 additions and 9 deletions

View file

@ -149,7 +149,8 @@ async def regular_user(client_factory):
password = "password123"
async with client_factory.get_db_session() as db:
await create_user_with_roles(db, email, password, [ROLE_REGULAR])
user = await create_user_with_roles(db, email, password, [ROLE_REGULAR])
user_id = user.id
# Login to get cookies
response = await client_factory.post(
@ -162,6 +163,32 @@ async def regular_user(client_factory):
"password": password,
"cookies": dict(response.cookies),
"response": response,
"user": {"id": user_id, "email": email},
}
@pytest.fixture(scope="function")
async def alt_regular_user(client_factory):
"""Create a second regular user for tests needing multiple users."""
email = unique_email("alt_regular")
password = "password123"
async with client_factory.get_db_session() as db:
user = await create_user_with_roles(db, email, password, [ROLE_REGULAR])
user_id = user.id
# Login to get cookies
response = await client_factory.post(
"/api/auth/login",
json={"email": email, "password": password},
)
return {
"email": email,
"password": password,
"cookies": dict(response.cookies),
"response": response,
"user": {"id": user_id, "email": email},
}