Files
social-app/backend/tests/unit/v1/agent/test_owner_guard.py
T
qzl f0af44d840 refactor(backend): update API routes and service layer
- Update agent router/service/repository with new endpoints
- Update auth routes with phone-based authentication
- Update users service with new phone lookup
- Update schedule_items with new schemas
- Update message schemas with visibility support
- Update settings with new automation scheduler config
- Update CLI with new commands
- Update tests to match new API contracts
2026-03-19 18:42:59 +08:00

17 lines
423 B
Python

from __future__ import annotations
from uuid import uuid4
import pytest
from fastapi import HTTPException
from core.auth.models import CurrentUser
from v1.agent.service import ensure_session_owner
def test_owner_guard_denies_non_owner() -> None:
user = CurrentUser(id=uuid4(), phone="self@example.com")
with pytest.raises(HTTPException):
ensure_session_owner(owner_id="other-user", current_user=user)