diff --git a/tests/e2e/setup_db.py b/tests/e2e/setup_db.py index d4e273b..0cfe3d8 100644 --- a/tests/e2e/setup_db.py +++ b/tests/e2e/setup_db.py @@ -62,6 +62,18 @@ async def seed() -> None: result["cred_username"] = "creduser" result["cred_password"] = "credpassword123" + # 5. Create a user with password for WebAuthn registration tests + # (login with password first, then register a passkey) + webauthn_user = User(userid="test-user-03", username="webauthnuser", groups=["users"]) + await user_repo.create(webauthn_user) + webauthn_password_hash = password_service.hash("webauthnpass123") + await cred_repo.create_password( + PasswordCredential(user_id=webauthn_user.userid, password_hash=webauthn_password_hash) + ) + result["webauthn_username"] = "webauthnuser" + result["webauthn_password"] = "webauthnpass123" + result["webauthn_userid"] = "test-user-03" + # 4. Create an expired/used magic link for negative test expired_link = await magic_link_service.create(username="expired") await magic_link_service.mark_used(expired_link.token)