feat: 增强处理历史资料规模与会话状态展示
This commit is contained in:
@@ -4,6 +4,7 @@ from agent_core.results import AgentResult
|
||||
from apps.audit.models import AgentAuditLog, DemoBusinessRecord, NotificationRecord
|
||||
from apps.audit.services import create_audit_log, create_notification_record
|
||||
from apps.chat.models import Conversation
|
||||
from apps.documents.models import SubmissionBatch
|
||||
from agent_core.tools.builtin_tools import query_demo_records
|
||||
|
||||
|
||||
@@ -354,3 +355,45 @@ def test_audit_detail_page_shows_conversation_node_results(client, db):
|
||||
assert "会话节点结果" in content
|
||||
assert "风险预警 / 已阻断" in content
|
||||
assert "飞书通知 / 失败" in content
|
||||
|
||||
|
||||
def test_audit_list_shows_batch_scale_and_conversation_status(client, db):
|
||||
SubmissionBatch.objects.create(
|
||||
batch_id="SUB-20260604-001",
|
||||
product_name="产品A",
|
||||
workflow_type="registration",
|
||||
conversation_id="conv-001",
|
||||
file_count=4,
|
||||
page_count=26,
|
||||
import_status="review_required",
|
||||
)
|
||||
Conversation.objects.create(
|
||||
conversation_id="conv-001",
|
||||
title="产品A",
|
||||
product_name="产品A",
|
||||
batch_id="SUB-20260604-001",
|
||||
task_status="failed",
|
||||
node_results=[
|
||||
{"label": "风险预警", "status": "已阻断"},
|
||||
{"label": "飞书通知", "status": "失败"},
|
||||
],
|
||||
)
|
||||
create_audit_log(
|
||||
"document_review",
|
||||
"注册审核智能体",
|
||||
"问题一",
|
||||
AgentResult(answer="回答一", status="failed"),
|
||||
batch_id="SUB-20260604-001",
|
||||
conversation_id="conv-001",
|
||||
product_name="产品A",
|
||||
)
|
||||
|
||||
response = client.get(reverse("audit:list"))
|
||||
|
||||
content = response.content.decode("utf-8")
|
||||
assert response.status_code == 200
|
||||
assert "资料规模" in content
|
||||
assert "4 份 / 26 页" in content
|
||||
assert "会话状态" in content
|
||||
assert "failed" in content
|
||||
assert "待复核" in content
|
||||
|
||||
Reference in New Issue
Block a user