feat: 增强资料包页导出回看与处理链路展示

This commit is contained in:
2026-06-04 03:15:56 +08:00
parent 5a4a176108
commit b2af88f870
2 changed files with 70 additions and 0 deletions

View File

@@ -540,3 +540,38 @@ def test_document_list_shows_latest_export_record_for_batch(client, db):
assert response.status_code == 200
assert "最近导出" in content
assert "SUB-20260604-011-draft.docx" in content
def test_document_list_shows_export_history_links_and_processing_pipeline(client, db):
batch = SubmissionBatch.objects.create(
batch_id="SUB-20260604-012",
product_name="产品Z",
workflow_type="registration",
conversation_id="conv-012",
file_count=3,
page_count=18,
import_status="review_required",
)
ExportedDocument.objects.create(
batch=batch,
conversation_id="conv-012",
product_name="产品Z",
template_name="注册证导出模板",
template_version="V1.1",
export_mode="draft",
output_type="registration_word_export_report",
file_name="SUB-20260604-012-draft.docx",
relative_path="exports/20260604/SUB-20260604-012-draft.docx",
download_url="/media/exports/20260604/SUB-20260604-012-draft.docx",
)
response = client.get(reverse("documents:list"))
content = response.content.decode("utf-8")
assert response.status_code == 200
assert "处理链路总览" in content
assert "原始文件接收" in content
assert "切片与索引入库" in content
assert reverse("audit:list") in content
assert "查看导出记录" in content
assert f"{reverse('audit:list')}?keyword=SUB-20260604-012" in content