This commit is contained in:
zlwu committed 2026-10-17 11:46:53 +08:00
1 parent 48dcf991dc
commit be2226e4ca
100 files changed
+61340 -40975

No files matched your search

@@ -0,0 +1,23 @@
import pytest
from app.core.protocol_status_display import (
assert_protocol_status_transition,
status_transition_denied_message,
)
def test_expired_protocol_cannot_void_and_message_uses_chinese_labels():
assert status_transition_denied_message("ygq", "yzf") == "状态已过期不可转为已作废"
assert status_transition_denied_message("ygq", "yzf", kind="donation") == "状态已过期不可转为已作废"
with pytest.raises(ValueError, match="状态已过期不可转为已作废"):
assert_protocol_status_transition("ygq", "yzf", kind="protocol")
with pytest.raises(ValueError, match="状态已过期不可转为已作废"):
assert_protocol_status_transition("ygq", "yzf", kind="donation")
def test_active_protocol_can_void_and_same_status_is_allowed():
assert_protocol_status_transition("sxz", "yzf", kind="protocol")
assert_protocol_status_transition("sxz", "zky", kind="protocol")
assert_protocol_status_transition("sxz", "zckc", kind="donation")
assert_protocol_status_transition("ygq", "ygq", kind="protocol")
assert_protocol_status_transition("ygq", "ygq", kind="donation")