fix: 事件异常测服会话和卡片不加 [test]

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-09-21 18:35:05 +08:00
co-authored by Cursor
parent a878b046d2
commit 8afe909230
3 changed files with 19 additions and 8 deletions
+12 -1
View File
@@ -166,6 +166,7 @@ class TestEventExceptionCopy(unittest.TestCase):
self.assertNotIn("@王五", text)
def test_test_prefix(self) -> None:
"""测服会话和应用卡片都不加 [test]。"""
text = copy.event_exception_session_text(
exception_type="销售响应超时",
work_order_no="WO1",
@@ -174,7 +175,17 @@ class TestEventExceptionCopy(unittest.TestCase):
mention=False,
test_prefix=True,
)
self.assertTrue(text.startswith("[test] "))
self.assertFalse(text.startswith("[test]"))
self.assertNotIn("[test]", text)
payload = copy.event_exception_alert_payload(
card_title="销售响应异常",
work_order_no="WO1",
hours=1,
test_prefix=True,
)
title = (payload.get("template_card") or {}).get("main_title", {}).get("title") or ""
self.assertEqual(title, "销售响应异常")
self.assertNotIn("[test]", title)
def test_app_card(self) -> None:
payload = copy.event_exception_alert_payload(