mirror of
https://github.com/stijndcl/didier.git
synced 2026-04-07 23:55:46 +02:00
Fix wordle code
This commit is contained in:
parent
8a4baf6bb8
commit
73d44de46e
11 changed files with 58 additions and 48 deletions
|
|
@ -54,7 +54,7 @@ async def test_get_birthdays_on_day(postgres: AsyncSession, user: User):
|
|||
"""Test getting all birthdays on a given day"""
|
||||
await crud.add_birthday(postgres, user.user_id, datetime.today().replace(year=2001))
|
||||
|
||||
user_2 = await users.get_or_add(postgres, user.user_id + 1)
|
||||
user_2 = await users.get_or_add_user(postgres, user.user_id + 1)
|
||||
await crud.add_birthday(postgres, user_2.user_id, datetime.today() + timedelta(weeks=1))
|
||||
birthdays = await crud.get_birthdays_on_day(postgres, datetime.today())
|
||||
assert len(birthdays) == 1
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@ from database.schemas import User
|
|||
|
||||
async def test_get_or_add_non_existing(postgres: AsyncSession):
|
||||
"""Test get_or_add for a user that doesn't exist"""
|
||||
await crud.get_or_add(postgres, 1)
|
||||
await crud.get_or_add_user(postgres, 1)
|
||||
statement = select(User)
|
||||
res = (await postgres.execute(statement)).scalars().all()
|
||||
|
||||
|
|
@ -18,8 +18,8 @@ async def test_get_or_add_non_existing(postgres: AsyncSession):
|
|||
|
||||
async def test_get_or_add_existing(postgres: AsyncSession):
|
||||
"""Test get_or_add for a user that does exist"""
|
||||
user = await crud.get_or_add(postgres, 1)
|
||||
user = await crud.get_or_add_user(postgres, 1)
|
||||
bank = user.bank
|
||||
|
||||
assert await crud.get_or_add(postgres, 1) == user
|
||||
assert (await crud.get_or_add(postgres, 1)).bank == bank
|
||||
assert await crud.get_or_add_user(postgres, 1) == user
|
||||
assert (await crud.get_or_add_user(postgres, 1)).bank == bank
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue