diff --git a/tests/conftest.py b/tests/conftest.py index 9908d35..8756fb0 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -177,10 +177,8 @@ async def _create_test_user_and_session( async with db_engine.begin() as conn: await conn.execute( text( - "INSERT INTO users (id, email, hashed_password, display_name, " - "email_verified, created_at, updated_at) " - "VALUES (:id, :email, :hashed_password, :display_name, :email_verified, " - ":created_at, :updated_at)" + "INSERT INTO users (id, email, hashed_password, display_name, email_verified, email_inbound_token, created_at, updated_at) " + "VALUES (:id, :email, :hashed_password, :display_name, :email_verified, :email_inbound_token, :created_at, :updated_at)" ), { "id": user_id, @@ -188,6 +186,7 @@ async def _create_test_user_and_session( "hashed_password": "not-used-with-better-auth", "display_name": display_name, "email_verified": False, + "email_inbound_token": secrets.token_urlsafe(16), "created_at": now, "updated_at": now, }, diff --git a/tests/test_auth/test_auth_endpoints.py b/tests/test_auth/test_auth_endpoints.py index c2ed7c2..3c3d03a 100644 --- a/tests/test_auth/test_auth_endpoints.py +++ b/tests/test_auth/test_auth_endpoints.py @@ -138,9 +138,8 @@ async def test_expired_session_rejected(client, db_engine): async with db_engine.begin() as conn: await conn.execute( text( - "INSERT INTO users (id, email, hashed_password, display_name, " - "email_verified, created_at, updated_at) " - "VALUES (:id, :email, :hp, :dn, :ev, :ca, :ua)" + "INSERT INTO users (id, email, hashed_password, display_name, email_verified, email_inbound_token, created_at, updated_at) " + "VALUES (:id, :email, :hp, :dn, :ev, :token, :ca, :ua)" ), { "id": user_id, @@ -148,6 +147,7 @@ async def test_expired_session_rejected(client, db_engine): "hp": "unused", "dn": "Expired User", "ev": False, + "token": secrets.token_urlsafe(16), "ca": now, "ua": now, }, diff --git a/tests/test_e2e/test_auth_validation.py b/tests/test_e2e/test_auth_validation.py index a4db942..fd98933 100644 --- a/tests/test_e2e/test_auth_validation.py +++ b/tests/test_e2e/test_auth_validation.py @@ -64,17 +64,17 @@ class TestSessionValidation: async with db_engine.begin() as conn: await conn.execute( - text( - "INSERT INTO users (id, email, hashed_password, display_name, " - "email_verified, created_at, updated_at) " - "VALUES (:id, :email, :hp, :dn, :ev, :ca, :ua)" - ), +text( + "INSERT INTO users (id, email, hashed_password, display_name, email_verified, email_inbound_token, created_at, updated_at) " + "VALUES (:id, :email, :hp, :dn, :ev, :token, :ca, :ua)" + ), { "id": user_id, "email": "expired@e2e.com", "hp": "unused", "dn": "Expired User", "ev": False, + "token": secrets.token_urlsafe(16), "ca": now, "ua": now, },