diff --git a/tests/conftest.py b/tests/conftest.py index 1aa8666..1e62c19 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -9,7 +9,7 @@ import pytest import pytest_asyncio from sqlalchemy.ext.asyncio import AsyncSession, async_sessionmaker, create_async_engine -from app.models.base import Base +from app.models.base import Base, utc_now from app.models.tenant import Tenant from app.models.agent import Agent from app.models.registration_token import RegistrationToken @@ -139,6 +139,7 @@ async def test_agent_with_secret( status="online", token="", # Empty for new auth scheme secret_hash=secret_hash, + last_heartbeat=utc_now(), ) db.add(agent) await db.commit() diff --git a/tests/routes/test_agent_auth.py b/tests/routes/test_agent_auth.py index a201e27..dfccb39 100644 --- a/tests/routes/test_agent_auth.py +++ b/tests/routes/test_agent_auth.py @@ -109,6 +109,7 @@ class TestGetCurrentAgentCompat: x_agent_id=None, x_agent_secret=None, authorization=f"Bearer {test_agent_legacy.token}", + agent_id=test_agent_legacy.id, # Legacy auth requires agent_id ) assert result.id == test_agent_legacy.id