generated from john/python-template
This commit is contained in:
@@ -153,6 +153,36 @@ class TestDocumentsPageRendering:
|
||||
assert "1924-07-04" not in response.text
|
||||
assert "PIPELINE JOBS" in response.text.upper()
|
||||
assert "Edit Document" in response.text
|
||||
assert "Back to Documents" in response.text
|
||||
|
||||
@pytest.mark.asyncio
|
||||
async def test_document_detail_page_renders_person_context_back_button(self, app_client, seed_person_and_document):
|
||||
_, client = app_client
|
||||
doc_id, person_id = seed_person_and_document
|
||||
|
||||
response = client.get(f"/ui/documents/{doc_id}?from=person&person_id={person_id}")
|
||||
|
||||
assert response.status_code == 200
|
||||
assert "Back to Person" in response.text
|
||||
|
||||
@pytest.mark.asyncio
|
||||
async def test_document_detail_page_renders_job_context_back_button(self, app_client):
|
||||
_, client = app_client
|
||||
|
||||
async with session_scope() as session:
|
||||
doc = Document(name="Job-linked Document")
|
||||
session.add(doc)
|
||||
await session.flush()
|
||||
job = Job(document_id=doc.id)
|
||||
session.add(job)
|
||||
await session.commit()
|
||||
doc_id = str(doc.id)
|
||||
job_id = str(job.id)
|
||||
|
||||
response = client.get(f"/ui/documents/{doc_id}?from=job&job_id={job_id}")
|
||||
|
||||
assert response.status_code == 200
|
||||
assert "Back to Job" in response.text
|
||||
|
||||
@pytest.mark.asyncio
|
||||
async def test_document_jobs_page_redirects_to_filtered_jobs(self, app_client):
|
||||
|
||||
Reference in New Issue
Block a user