Skip to content

armgit / dify

Public Imported from GitHub
0

Build Agentic workflows, RAG pipelines, with rich AI model and tool support on one collaborative workspace. Deploy on cloud, VPC, or self-hosted, so teams move from prototype to production without rebuilding the stack.

test(api): build recipient payload fixtures from RecipientType members (#43955)

haloneko16a2f5abd572
diff --git a/api/tests/unit_tests/tasks/test_mail_human_input_delivery_task.py b/api/tests/unit_tests/tasks/test_mail_human_input_delivery_task.py
index 4877ea30283..739db0d5877 100644
--- a/api/tests/unit_tests/tasks/test_mail_human_input_delivery_task.py
+++ b/api/tests/unit_tests/tasks/test_mail_human_input_delivery_task.py
@@ -182,7 +182,7 @@ def test_dispatch_human_input_email_task_sanitizes_subject(
def test_parse_recipient_payload_reads_email_and_type():
- payload = json.dumps({"email": "[email protected]", "TYPE": RecipientType.EMAIL_MEMBER.value})
+ payload = json.dumps({"email": "[email protected]", "TYPE": RecipientType.EMAIL_MEMBER})
assert task_module._parse_recipient_payload(payload) == ("[email protected]", RecipientType.EMAIL_MEMBER)
@@ -191,9 +191,9 @@ def test_parse_recipient_payload_reads_email_and_type():
"payload",
[
"not json",
- json.dumps({"TYPE": RecipientType.EMAIL_MEMBER.value}),
+ json.dumps({"TYPE": RecipientType.EMAIL_MEMBER}),
json.dumps({"email": "[email protected]", "TYPE": "unknown-channel"}),
- json.dumps({"email": 42, "TYPE": RecipientType.EMAIL_MEMBER.value}),
+ json.dumps({"email": 42, "TYPE": RecipientType.EMAIL_MEMBER}),
],
)
def test_parse_recipient_payload_rejects_unusable_payloads(payload: str):