generated from john/python-template
V4.1 revisions in preparation for v4.2. AI data capture now better defined.
This commit is contained in:
@@ -86,6 +86,8 @@ async def seed_job(app_client: tuple[FastAPI, TestClient]) -> Callable[..., Awai
|
||||
error_detail: str | None = None,
|
||||
revision_text: str | None = None,
|
||||
source_file: Path | None = None,
|
||||
ai_metadata: dict | None = None,
|
||||
raw_api_response: dict | None = None,
|
||||
) -> UUID:
|
||||
async with session_scope() as session:
|
||||
stored_path = app.state.settings.upload_dir / filename
|
||||
@@ -130,6 +132,8 @@ async def seed_job(app_client: tuple[FastAPI, TestClient]) -> Callable[..., Awai
|
||||
),
|
||||
raw_transcription=transcription_text,
|
||||
error_detail=error_detail,
|
||||
ai_metadata=ai_metadata,
|
||||
raw_api_response=raw_api_response,
|
||||
)
|
||||
)
|
||||
|
||||
|
||||
@@ -118,7 +118,6 @@ class TestDocumentsPageRendering:
|
||||
assert "Letter from Hig" in response.text
|
||||
assert "ZC-1924-001" in response.text
|
||||
assert "Zenna Cochran" in response.text
|
||||
assert f"/ui/people/{seed_person_and_document[1]}" in response.text
|
||||
assert "PIPELINE JOBS" in response.text.upper()
|
||||
assert "Edit Document" in response.text
|
||||
|
||||
|
||||
@@ -48,8 +48,10 @@ class TestPeoplePageRendering:
|
||||
assert response.status_code == 200
|
||||
assert "Create Person Record" in response.text
|
||||
assert "Full name is required." in response.text
|
||||
assert "Birth date (YYYY-MM-DD)" in response.text
|
||||
assert "Death date (YYYY-MM-DD)" in response.text
|
||||
assert "Birth date" in response.text
|
||||
assert "Death date" in response.text
|
||||
assert "Birth date (YYYY-MM-DD)" not in response.text
|
||||
assert "Death date (YYYY-MM-DD)" not in response.text
|
||||
assert "FamilySearch ID" in response.text
|
||||
assert "Biography" in response.text
|
||||
assert "Save person" in response.text
|
||||
|
||||
@@ -192,6 +192,8 @@ class TestSourcesPageRendering:
|
||||
transcription_text="original transcription text",
|
||||
revision_text="human revision text",
|
||||
source_file=fixture_path,
|
||||
ai_metadata={"finish_reason": "stop", "confidence": 0.98},
|
||||
raw_api_response={"id": "response-123", "model": "test-model"},
|
||||
)
|
||||
|
||||
async with session_scope() as session:
|
||||
@@ -216,6 +218,10 @@ class TestSourcesPageRendering:
|
||||
assert "Save revision" in response.text
|
||||
assert "Previous Page" in response.text
|
||||
assert "Next Page" in response.text
|
||||
assert "AI Metadata" in response.text
|
||||
assert "Raw API Response" in response.text
|
||||
assert "finish_reason" in response.text
|
||||
assert "response-123" in response.text
|
||||
|
||||
@pytest.mark.asyncio
|
||||
async def test_source_delete_page_blocks_when_source_is_job_linked(
|
||||
|
||||
Reference in New Issue
Block a user