feat(regulatory): 增加适用条件确认暂停恢复
This commit is contained in:
@@ -50,9 +50,63 @@ def test_workspace_renders_regulatory_workflow_card(client, django_user_model):
|
||||
assert "data-regulatory-status-url-template" in content
|
||||
|
||||
|
||||
def test_workspace_renders_condition_confirmation_form(client, django_user_model):
|
||||
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,
|
||||
)
|
||||
regulatory = RegulatoryReviewBatch.objects.create(
|
||||
conversation=conversation,
|
||||
user=user,
|
||||
source_summary_batch=summary,
|
||||
batch_no="RR-WAIT",
|
||||
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": "甲胎蛋白检测试剂盒",
|
||||
},
|
||||
},
|
||||
},
|
||||
)
|
||||
WorkflowNodeRun.objects.create(
|
||||
workflow_type="regulatory_review",
|
||||
workflow_batch_id=regulatory.pk,
|
||||
node_group="condition_confirm",
|
||||
node_code="condition_confirm",
|
||||
node_name="适用条件确认",
|
||||
status=WorkflowNodeRun.Status.WAITING_USER,
|
||||
progress=50,
|
||||
)
|
||||
client.force_login(user)
|
||||
|
||||
response = client.get(f"{reverse('home')}?conversation={conversation.pk}")
|
||||
|
||||
content = response.content.decode("utf-8")
|
||||
assert "适用条件确认" in content
|
||||
assert "data-condition-confirm-form" in content
|
||||
assert "体外诊断试剂" in content
|
||||
assert "甲胎蛋白检测试剂盒" in content
|
||||
|
||||
|
||||
def test_frontend_selects_status_url_by_workflow_type():
|
||||
script = open("static/js/app.js", encoding="utf-8").read()
|
||||
|
||||
assert "workflow_type" in script
|
||||
assert "data-regulatory-status-url-template" in script
|
||||
assert "statusUrlForWorkflow" in script
|
||||
assert "bindConditionConfirmForms" in script
|
||||
assert "data-condition-confirm-form" in script
|
||||
|
||||
Reference in New Issue
Block a user