Fix unit test errors

This commit is contained in:
Jim Lancaster
2026-08-05 13:27:30 -05:00
parent fd3ca60008
commit 9219adaf0c
7 changed files with 15 additions and 116 deletions
+7 -5
View File
@@ -32,7 +32,7 @@ class TestSourceModelProperties:
@pytest.mark.asyncio
async def test_source_properties_with_document_and_job_sources(self, seed_job):
job_id = seed_job(
job_id = await seed_job(
filename="source_prop_test.png",
status=JobStatus.FAILED,
transcription_text=None,
@@ -134,9 +134,10 @@ class TestSourcesPageRendering:
assert "target_page.png" in response.text
assert "other_page.png" not in response.text
@pytest.mark.asyncio
def test_sources_page_filters_to_job_context(self, app_client, seed_job):
_, client = app_client
job_id = seed_job(filename="job-page.png", transcription_text="job text")
job_id = await seed_job(filename="job-page.png", transcription_text="job text")
response = client.get(f"/ui/sources?job_id={job_id}")
@@ -145,11 +146,12 @@ class TestSourcesPageRendering:
assert "Back to Job" in response.text
assert "job-page.png" in response.text
@pytest.mark.asyncio
def test_sources_page_job_context_shows_job_source_status_and_error_detail(
self, app_client, seed_job
):
_, client = app_client
job_id = seed_job(
job_id = await seed_job(
filename="job-failed-page.png",
status=JobStatus.FAILED,
transcription_text=None,
@@ -175,7 +177,7 @@ class TestSourcesPageRendering:
/ "valid"
/ "small_png.png"
)
job_id = seed_job(
job_id = await seed_job(
filename="detail-source.png",
transcription_text="original transcription text",
revision_text="human revision text",
@@ -205,7 +207,7 @@ class TestSourcesPageRendering:
self, app_client, seed_job
):
_, client = app_client
job_id = seed_job(filename="linked-source.png", transcription_text="linked text")
job_id = await seed_job(filename="linked-source.png", transcription_text="linked text")
async with session_scope() as session:
job = await session.get(Job, job_id)