feat: add Consent model, migration, and repository
This commit is contained in:
parent
16f3e039d9
commit
9ccc6c885f
7 changed files with 200 additions and 3 deletions
|
|
@ -13,7 +13,7 @@ async def test_run_migrations_applies_initial() -> None:
|
|||
async with aiosqlite.connect(":memory:") as db:
|
||||
await db.execute("PRAGMA foreign_keys=ON")
|
||||
count = await run_migrations(db, MIGRATIONS_DIR)
|
||||
assert count == 1
|
||||
assert count == 2
|
||||
async with db.execute("SELECT name FROM sqlite_master WHERE type='table' AND name='users'") as cursor:
|
||||
row = await cursor.fetchone()
|
||||
assert row is not None
|
||||
|
|
@ -24,7 +24,7 @@ async def test_run_migrations_skips_already_applied() -> None:
|
|||
await db.execute("PRAGMA foreign_keys=ON")
|
||||
first_count = await run_migrations(db, MIGRATIONS_DIR)
|
||||
second_count = await run_migrations(db, MIGRATIONS_DIR)
|
||||
assert first_count == 1
|
||||
assert first_count == 2
|
||||
assert second_count == 0
|
||||
|
||||
|
||||
|
|
@ -39,4 +39,5 @@ async def test_run_migrations_creates_all_tables() -> None:
|
|||
assert "webauthn_credentials" in tables
|
||||
assert "password_credentials" in tables
|
||||
assert "magic_links" in tables
|
||||
assert "user_consents" in tables
|
||||
assert "_migrations" in tables
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue