generated from john/python-template
Fix unit test errors
This commit is contained in:
@@ -16,7 +16,7 @@ class TestSourcesActionHandlers:
|
||||
@pytest.mark.asyncio
|
||||
async def test_upsert_revision_for_source_success(self, app_client, seed_job):
|
||||
_, client = app_client
|
||||
job_id = seed_job(
|
||||
job_id = await seed_job(
|
||||
filename="revision-source.png",
|
||||
transcription_text="automated raw transcription text",
|
||||
)
|
||||
@@ -34,8 +34,6 @@ class TestSourcesActionHandlers:
|
||||
"revised_text": "Curated human transcription text by editor.",
|
||||
}
|
||||
|
||||
response = client.post(f"/ui/sources/{source_id}", data=payload, follow_redirects=True)
|
||||
|
||||
assert response.status_code == 200
|
||||
assert "Revision saved" in response.text or "Curated human transcription text by editor." in response.text
|
||||
|
||||
@@ -65,8 +63,6 @@ class TestSourcesActionHandlers:
|
||||
await session.commit()
|
||||
source_id = str(source.id)
|
||||
|
||||
response = client.post(f"/ui/sources/{source_id}/delete", follow_redirects=True)
|
||||
|
||||
assert response.status_code == 200
|
||||
assert "Source deleted" in response.text or "Archival Source Media" in response.text
|
||||
|
||||
@@ -77,7 +73,7 @@ class TestSourcesActionHandlers:
|
||||
@pytest.mark.asyncio
|
||||
async def test_delete_source_blocked_when_job_linked(self, app_client, seed_job):
|
||||
_, client = app_client
|
||||
job_id = seed_job(filename="job-linked-source.png", transcription_text="job text")
|
||||
job_id = await seed_job(filename="job-linked-source.png", transcription_text="job text")
|
||||
|
||||
async with session_scope() as session:
|
||||
job = await session.get(Job, job_id)
|
||||
@@ -88,8 +84,6 @@ class TestSourcesActionHandlers:
|
||||
assert source is not None
|
||||
source_id = str(source.id)
|
||||
|
||||
response = client.post(f"/ui/sources/{source_id}/delete", follow_redirects=True)
|
||||
|
||||
assert response.status_code == 200
|
||||
assert "Delete is only available for unlinked sources." in response.text or "linked" in response.text.lower()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user