generated from john/python-template
Continue GC code review: Pydantic
This commit is contained in:
@@ -7,6 +7,7 @@ from uuid import uuid4
|
||||
import pytest
|
||||
from sqlmodel import select
|
||||
|
||||
from transcription.config import Settings
|
||||
from transcription.db.models import Document
|
||||
from transcription.db.models import DocumentPerson
|
||||
from transcription.db.models import DocumentPersonRole
|
||||
@@ -98,8 +99,8 @@ async def test_delete_document_blocks_when_dependencies_exist(default_session_fa
|
||||
|
||||
@pytest.mark.asyncio
|
||||
async def test_delete_document_succeeds_when_unlinked(default_session_factory, tmp_path):
|
||||
service = DocumentService(session_factory=default_session_factory)
|
||||
service.settings.upload_dir = tmp_path
|
||||
settings = Settings(openrouter_api_key="test-key", upload_dir=tmp_path)
|
||||
service = DocumentService(session_factory=default_session_factory, settings=settings)
|
||||
|
||||
document = await service.create_document(
|
||||
Document(
|
||||
@@ -123,9 +124,9 @@ async def test_delete_document_succeeds_when_unlinked(default_session_factory, t
|
||||
|
||||
@pytest.mark.asyncio
|
||||
async def test_delete_document_removes_person_links(default_session_factory, tmp_path):
|
||||
service = DocumentService(session_factory=default_session_factory)
|
||||
settings = Settings(openrouter_api_key="test-key", upload_dir=tmp_path)
|
||||
service = DocumentService(session_factory=default_session_factory, settings=settings)
|
||||
people_service = PeopleService(session_factory=default_session_factory)
|
||||
service.settings.upload_dir = tmp_path
|
||||
|
||||
document = await service.create_document(
|
||||
Document(
|
||||
@@ -163,8 +164,8 @@ async def test_delete_document_removes_person_links(default_session_factory, tmp
|
||||
|
||||
@pytest.mark.asyncio
|
||||
async def test_delete_document_removes_populated_storage_tree(default_session_factory, tmp_path):
|
||||
service = DocumentService(session_factory=default_session_factory)
|
||||
service.settings.upload_dir = tmp_path
|
||||
settings = Settings(openrouter_api_key="test-key", upload_dir=tmp_path)
|
||||
service = DocumentService(session_factory=default_session_factory, settings=settings)
|
||||
|
||||
document = await service.create_document(
|
||||
Document(
|
||||
|
||||
Reference in New Issue
Block a user