feat(ui): 工作台界面全部替换为element plus
This commit is contained in:
1 parent
26d213c05b
commit
d5f988a16c
38 files changed
+4501
-3087
No files matched your search
@@ -3,7 +3,7 @@ backend/tests/voucher_check/test_notify_config.py
|
||||
|
||||
用途:按文件类型配置缺件接收人,以及把缺件类型拆成每人一封。
|
||||
依赖:pytest、Flask client、notify_config_service、notification.send_batch_missing_summary。
|
||||
逻辑:GET/PUT 仅 is_platform_admin;未知规则码丢弃;发送时每人只看到自己负责且本批缺失的类型。
|
||||
逻辑:GET/PUT 仅 is_platform_admin;未知规则码丢弃;发送时每人只看到自己负责且本批缺失的类型,并收到同一份 Excel。
|
||||
"""
|
||||
|
||||
from __future__ import annotations
|
||||
@@ -179,14 +179,26 @@ def test_notify_config_rejects_non_admin_headers(app, client, user_headers):
|
||||
|
||||
|
||||
def test_send_batch_splits_one_card_per_user(app, monkeypatch):
|
||||
"""缺件通知按人拆信,正文只含该人负责的缺失类型。"""
|
||||
"""缺件通知按人拆信,正文只含该人负责的缺失类型,并给每人附上同一份 Excel。"""
|
||||
sent: list[tuple[str, str, str]] = []
|
||||
uploaded: list[tuple[bytes, str]] = []
|
||||
files: list[tuple[str, str]] = []
|
||||
|
||||
def _fake_send(wecom_userid, title, description, jump_url):
|
||||
sent.append((wecom_userid, title, description))
|
||||
return {"errcode": 0}
|
||||
|
||||
def _fake_upload(data, filename):
|
||||
uploaded.append((data, filename))
|
||||
return "media-vc-1"
|
||||
|
||||
def _fake_file(wecom_userid, media_id):
|
||||
files.append((wecom_userid, media_id))
|
||||
return {"errcode": 0}
|
||||
|
||||
monkeypatch.setattr("app.services.integrations.wecom.notify.send_wecom_textcard_message", _fake_send)
|
||||
monkeypatch.setattr("app.services.integrations.wecom.notify.upload_wecom_temp_media", _fake_upload)
|
||||
monkeypatch.setattr("app.services.integrations.wecom.notify.send_wecom_file_message", _fake_file)
|
||||
monkeypatch.setattr(
|
||||
"app.services.integrations.wecom.notify._create_audit",
|
||||
lambda *args, **kwargs: SimpleNamespace(
|
||||
@@ -279,6 +291,7 @@ def test_send_batch_splits_one_card_per_user(app, monkeypatch):
|
||||
},
|
||||
},
|
||||
excel_filename="voucher_check_sales_2026-08.xlsx",
|
||||
excel_bytes=b"voucher-xlsx",
|
||||
enabled=True,
|
||||
)
|
||||
assert status == "sent"
|
||||
@@ -306,3 +319,7 @@ def test_send_batch_splits_one_card_per_user(app, monkeypatch):
|
||||
assert "发票:缺" not in po_body
|
||||
assert "提单" in bl_body
|
||||
assert "PO订单:缺" not in bl_body
|
||||
# 关键断言:同一份 Excel 只上传一次,两个收件人都收到文件消息。
|
||||
assert uploaded == [(b"voucher-xlsx", "voucher_check_sales_2026-08.xlsx")]
|
||||
assert files == [("wx-po-recv", "media-vc-1"), ("wx-bl-recv", "media-vc-1")]
|
||||
assert "下一条 Excel" in po_body
|
||||
Reference in new issue
Block a user