Merge remote-tracking branch 'origin/development'
This commit is contained in:
@@ -14,7 +14,7 @@ from sqlalchemy.ext.asyncio import AsyncSession, async_sessionmaker
|
|||||||
|
|
||||||
from app.core.config import settings
|
from app.core.config import settings
|
||||||
from app.core.db import get_async_db, utc_now
|
from app.core.db import get_async_db, utc_now
|
||||||
from app.core.dependencies import get_sms_sender
|
from app.core.dependencies import get_object_storage, get_sms_sender
|
||||||
from app.features.auth import repo
|
from app.features.auth import repo
|
||||||
from app.features.auth.router import router as auth_router
|
from app.features.auth.router import router as auth_router
|
||||||
from tests.conftest import install_test_error_handlers
|
from tests.conftest import install_test_error_handlers
|
||||||
@@ -33,6 +33,7 @@ async def refresh_http_app(
|
|||||||
app.include_router(auth_router)
|
app.include_router(auth_router)
|
||||||
app.dependency_overrides[get_async_db] = _override_db
|
app.dependency_overrides[get_async_db] = _override_db
|
||||||
app.dependency_overrides[get_sms_sender] = lambda: MagicMock()
|
app.dependency_overrides[get_sms_sender] = lambda: MagicMock()
|
||||||
|
app.dependency_overrides[get_object_storage] = lambda: MagicMock()
|
||||||
return app
|
return app
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -8,6 +8,7 @@ import pytest
|
|||||||
from fastapi import FastAPI
|
from fastapi import FastAPI
|
||||||
from httpx import ASGITransport, AsyncClient
|
from httpx import ASGITransport, AsyncClient
|
||||||
|
|
||||||
|
from app.core.dependencies import get_object_storage
|
||||||
from app.core.errors import BadRequestError, NotFoundError
|
from app.core.errors import BadRequestError, NotFoundError
|
||||||
from app.features.auth.deps import get_auth_service
|
from app.features.auth.deps import get_auth_service
|
||||||
from app.features.auth.router import router as auth_router
|
from app.features.auth.router import router as auth_router
|
||||||
@@ -21,6 +22,7 @@ from tests.conftest import install_test_error_handlers
|
|||||||
async def test_auth_register_validation_returns_unified_422() -> None:
|
async def test_auth_register_validation_returns_unified_422() -> None:
|
||||||
app = install_test_error_handlers(FastAPI())
|
app = install_test_error_handlers(FastAPI())
|
||||||
app.include_router(auth_router)
|
app.include_router(auth_router)
|
||||||
|
app.dependency_overrides[get_object_storage] = lambda: MagicMock()
|
||||||
|
|
||||||
transport = ASGITransport(app=app, raise_app_exceptions=False)
|
transport = ASGITransport(app=app, raise_app_exceptions=False)
|
||||||
async with AsyncClient(transport=transport, base_url="http://test") as client:
|
async with AsyncClient(transport=transport, base_url="http://test") as client:
|
||||||
|
|||||||
@@ -133,10 +133,18 @@ async def test_record_human_ai_turn_with_segment_postgres_flush_order() -> None:
|
|||||||
if not settings.database_url.startswith("postgresql"):
|
if not settings.database_url.startswith("postgresql"):
|
||||||
pytest.skip("requires PostgreSQL")
|
pytest.skip("requires PostgreSQL")
|
||||||
|
|
||||||
|
from sqlalchemy import text
|
||||||
|
|
||||||
from app.core.db import AsyncSessionLocal, transactional
|
from app.core.db import AsyncSessionLocal, transactional
|
||||||
from app.features.conversation.models import Conversation
|
from app.features.conversation.models import Conversation
|
||||||
from app.features.user.models import User
|
from app.features.user.models import User
|
||||||
|
|
||||||
|
try:
|
||||||
|
async with AsyncSessionLocal() as db:
|
||||||
|
await db.execute(text("SELECT 1"))
|
||||||
|
except Exception:
|
||||||
|
pytest.skip("PostgreSQL not reachable")
|
||||||
|
|
||||||
uid = str(uuid.uuid4())
|
uid = str(uuid.uuid4())
|
||||||
cid = str(uuid.uuid4())
|
cid = str(uuid.uuid4())
|
||||||
sid = str(uuid.uuid4())
|
sid = str(uuid.uuid4())
|
||||||
|
|||||||
Reference in New Issue
Block a user