This commit is contained in:
zlwu committed 2026-09-11 21:03:53 +08:00
1 parent 195c89e6b7
commit d294ecad84
34 files changed
+8466 -7867

No files matched your search

@@ -156,3 +156,38 @@ def test_send_one_routes_approval_vs_cc():
)
assert kwargs["title"] == "李四 - 请假申请"
assert kwargs["process_name"] == "请假申请"
def test_schedule_oa_task_notifies_noop_when_disabled():
with patch("app.services.oa_wechat_notify.settings") as st, patch(
"app.services.oa_wechat_notify.threading.Thread"
) as th:
st.WX_MP_NOTIFY_ENABLED = False
from app.services.oa_wechat_notify import schedule_oa_task_notifies
schedule_oa_task_notifies(["t1"])
th.assert_not_called()
def test_schedule_oa_applicant_progress_noop_when_disabled():
with patch("app.services.oa_wechat_notify.settings") as st, patch(
"app.services.oa_wechat_notify.threading.Thread"
) as th:
st.WX_MP_NOTIFY_ENABLED = False
from app.services.oa_wechat_notify import schedule_oa_applicant_progress
schedule_oa_applicant_progress(
instance_id="i1", actor_user_id="u1", action="approve"
)
th.assert_not_called()
def test_notify_oa_tasks_sync_noop_when_disabled():
with patch("app.services.oa_wechat_notify.settings") as st, patch(
"app.services.oa_wechat_notify.SessionLocal"
) as session_local:
st.WX_MP_NOTIFY_ENABLED = False
from app.services.oa_wechat_notify import notify_oa_tasks_sync
notify_oa_tasks_sync(["t1"])
session_local.assert_not_called()