Add get by id method on DB adapter

This commit is contained in:
François Voron
2019-10-07 07:53:56 +02:00
parent c4ff6ca3fe
commit 51b67b0739
3 changed files with 12 additions and 1 deletions

View File

@ -37,10 +37,14 @@ async def test_queries(user, sqlalchemy_user_db):
user_db.is_superuser = True
await sqlalchemy_user_db.update(user_db)
# Get by id
id_user = await sqlalchemy_user_db.get(user.id)
assert id_user.id == user_db.id
assert id_user.is_superuser is True
# Get by email
email_user = await sqlalchemy_user_db.get_by_email(user.email)
assert email_user.id == user_db.id
assert email_user.is_superuser is True
# List
users = await sqlalchemy_user_db.list()