fix(regulatory): 修复无标签文档适用条件回显
This commit is contained in:
@@ -4,6 +4,7 @@ from django.urls import reverse
|
||||
from review_agent.models import (
|
||||
Conversation,
|
||||
FileSummaryBatch,
|
||||
FileSummaryItem,
|
||||
RegulatoryArtifact,
|
||||
RegulatoryNotificationRecord,
|
||||
RegulatoryReviewBatch,
|
||||
@@ -108,6 +109,55 @@ def test_workspace_renders_condition_confirmation_form(client, django_user_model
|
||||
assert "data-condition-confirm-form" not in content[summary_index:]
|
||||
|
||||
|
||||
def test_workspace_refreshes_incomplete_condition_confirmation_candidates(client, settings, tmp_path, django_user_model):
|
||||
settings.MEDIA_ROOT = tmp_path
|
||||
user = django_user_model.objects.create_user(username="owner", password="pass")
|
||||
conversation = Conversation.objects.create(user=user, title="会话")
|
||||
summary = FileSummaryBatch.objects.create(
|
||||
conversation=conversation,
|
||||
user=user,
|
||||
batch_no="FS-OK",
|
||||
status=FileSummaryBatch.Status.SUCCESS,
|
||||
product_name="第1章 监管信息",
|
||||
)
|
||||
application = tmp_path / "application.txt"
|
||||
application.write_text(
|
||||
"卡尤迪生物科技宜兴有限公司申请境内第三类体外诊断试剂"
|
||||
"呼吸道合胞病毒、肺炎支原体核酸检测试剂盒(荧光PCR法)产品注册。",
|
||||
encoding="utf-8",
|
||||
)
|
||||
FileSummaryItem.objects.create(
|
||||
batch=summary,
|
||||
file_index=1,
|
||||
directory_level="第1章 监管信息",
|
||||
file_name="符合标准的清单.txt",
|
||||
file_type="txt",
|
||||
relative_path="第1章 监管信息/符合标准的清单.txt",
|
||||
storage_path=str(application),
|
||||
)
|
||||
RegulatoryReviewBatch.objects.create(
|
||||
conversation=conversation,
|
||||
user=user,
|
||||
source_summary_batch=summary,
|
||||
batch_no="RR-WAIT-EMPTY",
|
||||
status=RegulatoryReviewBatch.Status.WAITING_USER,
|
||||
condition_json={
|
||||
"confirmed": False,
|
||||
"candidates": {
|
||||
"product_category": {"label": "产品类别", "input_type": "select", "options": ["其他"], "suggested": "其他"},
|
||||
"product_name": {"label": "产品名称", "input_type": "text", "suggested": ""},
|
||||
},
|
||||
},
|
||||
)
|
||||
client.force_login(user)
|
||||
|
||||
response = client.get(f"{reverse('home')}?conversation={conversation.pk}")
|
||||
|
||||
content = response.content.decode("utf-8")
|
||||
assert "体外诊断试剂" in content
|
||||
assert "呼吸道合胞病毒、肺炎支原体核酸检测试剂盒(荧光PCR法)" in content
|
||||
|
||||
|
||||
def test_workspace_renders_rectification_actions_and_summaries(client, tmp_path, django_user_model):
|
||||
user = django_user_model.objects.create_user(username="owner", password="pass")
|
||||
conversation = Conversation.objects.create(user=user, title="会话")
|
||||
|
||||
Reference in New Issue
Block a user