feat: 支持处理历史按风险状态筛选

This commit is contained in:
2026-06-04 01:32:35 +08:00
parent 73c6336600
commit e7e3202714
4 changed files with 60 additions and 1 deletions

View File

@@ -232,6 +232,8 @@ def test_audit_list_shows_risk_and_notification_status(client, db):
assert "high" in content
assert "通知状态" in content
assert "sent" in content
assert "通知原因" in content
assert "task_completed" in content
def test_audit_list_can_filter_by_notification_status(client, db):
@@ -286,6 +288,42 @@ def test_audit_list_can_filter_by_notification_status(client, db):
assert "产品A" not in content
def test_audit_list_can_filter_by_risk_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_audit_log(
"document_review",
"注册审核智能体",
"问题二",
AgentResult(
answer="回答二",
status="success",
structured_output={"highest_risk_level": "low"},
),
batch_id="SUB-20260604-002",
conversation_id="conv-002",
product_name="产品B",
)
response = client.get(reverse("audit:list"), {"risk_status": "high"})
content = response.content.decode("utf-8")
assert response.status_code == 200
assert "产品A" in content
assert "产品B" not in content
def test_audit_detail_page_shows_conversation_node_results(client, db):
Conversation.objects.create(
conversation_id="conv-001",