fix: 事件异常测服会话和卡片不加 [test]
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -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(
|
||||
|
||||
Reference in New Issue
Block a user