feat: 增强处理历史风险与通知状态展示
This commit is contained in:
@@ -197,6 +197,95 @@ def test_audit_list_supports_batch_and_product_filters(client, db):
|
||||
assert "产品B" not in content
|
||||
|
||||
|
||||
def test_audit_list_shows_risk_and_notification_status(client, db):
|
||||
create_audit_log(
|
||||
"document_review",
|
||||
"注册审核智能体",
|
||||
"问题一",
|
||||
AgentResult(
|
||||
answer="回答一",
|
||||
status="success",
|
||||
structured_output={"highest_risk_level": "high"},
|
||||
),
|
||||
batch_id="SUB-20260604-001",
|
||||
conversation_id="conv-001",
|
||||
product_name="产品A",
|
||||
)
|
||||
create_notification_record(
|
||||
batch_id="SUB-20260604-001",
|
||||
conversation_id="conv-001",
|
||||
product_name="产品A",
|
||||
trigger_source="risk_report",
|
||||
notify_reason="task_completed",
|
||||
owner_role="注册资料负责人",
|
||||
feishu_user_id="ou_demo_1",
|
||||
message_status="sent",
|
||||
web_detail_url="https://example.com/detail/1",
|
||||
receipt={"message_id": "msg-1"},
|
||||
)
|
||||
|
||||
response = client.get(reverse("audit:list"))
|
||||
|
||||
content = response.content.decode("utf-8")
|
||||
assert response.status_code == 200
|
||||
assert "风险状态" in content
|
||||
assert "high" in content
|
||||
assert "通知状态" in content
|
||||
assert "sent" in content
|
||||
|
||||
|
||||
def test_audit_list_can_filter_by_notification_status(client, db):
|
||||
create_audit_log(
|
||||
"document_review",
|
||||
"注册审核智能体",
|
||||
"问题一",
|
||||
AgentResult(answer="回答一", status="success"),
|
||||
batch_id="SUB-20260604-001",
|
||||
conversation_id="conv-001",
|
||||
product_name="产品A",
|
||||
)
|
||||
create_audit_log(
|
||||
"document_review",
|
||||
"注册审核智能体",
|
||||
"问题二",
|
||||
AgentResult(answer="回答二", status="failed"),
|
||||
batch_id="SUB-20260604-002",
|
||||
conversation_id="conv-002",
|
||||
product_name="产品B",
|
||||
)
|
||||
create_notification_record(
|
||||
batch_id="SUB-20260604-001",
|
||||
conversation_id="conv-001",
|
||||
product_name="产品A",
|
||||
trigger_source="risk_report",
|
||||
notify_reason="task_completed",
|
||||
owner_role="注册资料负责人",
|
||||
feishu_user_id="ou_demo_1",
|
||||
message_status="sent",
|
||||
web_detail_url="https://example.com/detail/1",
|
||||
receipt={"message_id": "msg-1"},
|
||||
)
|
||||
create_notification_record(
|
||||
batch_id="SUB-20260604-002",
|
||||
conversation_id="conv-002",
|
||||
product_name="产品B",
|
||||
trigger_source="risk_report",
|
||||
notify_reason="task_failed",
|
||||
owner_role="注册资料负责人",
|
||||
feishu_user_id="ou_demo_2",
|
||||
message_status="failed",
|
||||
web_detail_url="https://example.com/detail/2",
|
||||
receipt={"message_id": "msg-2"},
|
||||
)
|
||||
|
||||
response = client.get(reverse("audit:list"), {"notify_status": "failed"})
|
||||
|
||||
content = response.content.decode("utf-8")
|
||||
assert response.status_code == 200
|
||||
assert "产品B" in content
|
||||
assert "产品A" not in content
|
||||
|
||||
|
||||
def test_audit_detail_page_shows_conversation_node_results(client, db):
|
||||
Conversation.objects.create(
|
||||
conversation_id="conv-001",
|
||||
|
||||
Reference in New Issue
Block a user