fix(regulatory): 轮询时加载条件确认卡
This commit is contained in:
@@ -43,3 +43,40 @@ def test_regulatory_batch_status_requires_owner(client, django_user_model):
|
||||
assert payload["batch"]["workflow_type"] == "regulatory_review"
|
||||
assert payload["batch"]["batch_no"] == "RR-STATUS"
|
||||
assert payload["nodes"][0]["node_code"] == "prepare"
|
||||
|
||||
|
||||
def test_regulatory_batch_status_exposes_condition_confirmation(client, django_user_model):
|
||||
owner = django_user_model.objects.create_user(username="owner", password="pass")
|
||||
conversation = Conversation.objects.create(user=owner, title="会话")
|
||||
summary = FileSummaryBatch.objects.create(
|
||||
conversation=conversation,
|
||||
user=owner,
|
||||
batch_no="FS-OK",
|
||||
status=FileSummaryBatch.Status.SUCCESS,
|
||||
)
|
||||
batch = RegulatoryReviewBatch.objects.create(
|
||||
conversation=conversation,
|
||||
user=owner,
|
||||
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": "体外诊断试剂",
|
||||
}
|
||||
},
|
||||
},
|
||||
)
|
||||
client.force_login(owner)
|
||||
|
||||
response = client.get(reverse("regulatory_review_batch_status", args=[batch.pk]))
|
||||
|
||||
payload = response.json()
|
||||
assert payload["batch"]["status"] == RegulatoryReviewBatch.Status.WAITING_USER
|
||||
assert payload["condition_confirmation"]["batch_id"] == batch.pk
|
||||
assert payload["condition_confirmation"]["candidates"]["product_category"]["suggested"] == "体外诊断试剂"
|
||||
|
||||
Reference in New Issue
Block a user