feat: 增强审核智能体页目录与一致性能力卡展示
This commit is contained in:
@@ -406,6 +406,66 @@ def test_chat_page_shows_top_context_and_recommended_prompts(client, db):
|
||||
assert "请给出当前资料包的高风险项、责任人和整改建议" in content
|
||||
|
||||
|
||||
def test_chat_page_shows_overview_card_from_conversation_summary(client, db):
|
||||
batch, conversation = _create_conversation_with_batch()
|
||||
conversation.latest_summary = {
|
||||
"structured_output": {
|
||||
"output_type": "registration_overview_report",
|
||||
"batch_id": batch.batch_id,
|
||||
"product_name": batch.product_name,
|
||||
"file_count": 2,
|
||||
"total_page_count": 12,
|
||||
"chapter_summary": [
|
||||
{"chapter_code": "CH1", "document_count": 2},
|
||||
],
|
||||
"documents": [
|
||||
{
|
||||
"original_name": "说明书.md",
|
||||
"chapter_code": "CH1",
|
||||
"page_count": 12,
|
||||
"document_role": "product_manual",
|
||||
}
|
||||
],
|
||||
"warnings": ["Word 页数待复核"],
|
||||
}
|
||||
}
|
||||
conversation.save(update_fields=["latest_summary", "updated_at"])
|
||||
|
||||
response = client.get(reverse("chat:detail", args=[conversation.conversation_id]))
|
||||
|
||||
content = response.content.decode("utf-8")
|
||||
assert response.status_code == 200
|
||||
assert "目录汇总能力卡" in content
|
||||
assert "资料文件数" in content
|
||||
assert "CH1 / 2 份" in content
|
||||
assert "Word 页数待复核" in content
|
||||
|
||||
|
||||
def test_chat_page_shows_consistency_card_from_conversation_summary(client, db):
|
||||
batch, conversation = _create_conversation_with_batch()
|
||||
conversation.latest_summary = {
|
||||
"structured_output": {
|
||||
"output_type": "registration_consistency_report",
|
||||
"summary": "检测到跨文档字段冲突。",
|
||||
"conflict_items": [
|
||||
{"field_name": "产品名称", "issue": "申请表与说明书不一致"},
|
||||
],
|
||||
"mixed_document_risks": ["疑似混入其他产品资料"],
|
||||
"risk_level": "high",
|
||||
}
|
||||
}
|
||||
conversation.save(update_fields=["latest_summary", "updated_at"])
|
||||
|
||||
response = client.get(reverse("chat:detail", args=[conversation.conversation_id]))
|
||||
|
||||
content = response.content.decode("utf-8")
|
||||
assert response.status_code == 200
|
||||
assert "一致性核查能力卡" in content
|
||||
assert "申请表与说明书不一致" in content
|
||||
assert "疑似混入其他产品资料" in content
|
||||
assert "high" in content
|
||||
|
||||
|
||||
def test_chat_page_blocks_formal_export_when_word_export_node_is_blocked(client, db):
|
||||
batch, conversation = _create_conversation_with_batch()
|
||||
conversation.node_results = [
|
||||
|
||||
Reference in New Issue
Block a user