feat: 增强处理历史详情导出与通知回执展示
This commit is contained in:
@@ -397,3 +397,57 @@ def test_audit_list_shows_batch_scale_and_conversation_status(client, db):
|
||||
assert "会话状态" in content
|
||||
assert "failed" in content
|
||||
assert "待复核" in content
|
||||
|
||||
|
||||
def test_audit_detail_page_shows_export_summary_and_notification_receipt(client, db):
|
||||
Conversation.objects.create(
|
||||
conversation_id="conv-002",
|
||||
title="产品B",
|
||||
product_name="产品B",
|
||||
batch_id="SUB-20260604-002",
|
||||
task_status="success",
|
||||
node_results=[
|
||||
{"label": "Word 回填导出", "status": "待复核"},
|
||||
{"label": "飞书通知", "status": "已完成"},
|
||||
],
|
||||
)
|
||||
log = create_audit_log(
|
||||
"document_review",
|
||||
"注册审核智能体",
|
||||
"导出任务",
|
||||
AgentResult(
|
||||
answer="已生成导出草稿",
|
||||
status="success",
|
||||
structured_output={
|
||||
"export_status": "draft_only",
|
||||
"download_url": "/downloads/registration-report.docx",
|
||||
"blocked_items": ["风险项未清零"],
|
||||
},
|
||||
),
|
||||
batch_id="SUB-20260604-002",
|
||||
conversation_id="conv-002",
|
||||
product_name="产品B",
|
||||
)
|
||||
create_notification_record(
|
||||
batch_id="SUB-20260604-002",
|
||||
conversation_id="conv-002",
|
||||
product_name="产品B",
|
||||
trigger_source="word_export",
|
||||
notify_reason="task_completed",
|
||||
owner_role="注册资料负责人",
|
||||
feishu_user_id="ou_demo_9",
|
||||
message_status="sent",
|
||||
web_detail_url="https://example.com/detail/9",
|
||||
receipt={"message_id": "msg-9", "status": "sent"},
|
||||
)
|
||||
|
||||
response = client.get(reverse("audit:detail", args=[log.id]))
|
||||
|
||||
content = response.content.decode("utf-8")
|
||||
assert response.status_code == 200
|
||||
assert "导出状态摘要" in content
|
||||
assert "draft_only" in content
|
||||
assert "/downloads/registration-report.docx" in content
|
||||
assert "风险项未清零" in content
|
||||
assert "通知回执" in content
|
||||
assert "msg-9" in content
|
||||
|
||||
Reference in New Issue
Block a user