style(backend): ruff format 统一此前批次的排版残留
纯排版无行为变化(ruff format 重排 7 个此前批次的文件), 涉及模块集成回归全绿(67 passed)。 Co-Authored-By: Claude Code <noreply@anthropic.com>
This commit is contained in:
1 parent
6d612daf30
commit
9a70264b51
7 files changed
+13
-23
No files matched your search
@@ -151,9 +151,7 @@ class TestCrudFlow:
|
||||
assert dup.status_code == 400, dup.text
|
||||
assert "该公司名称与负责人的客户已存在" in dup.json()["message"]
|
||||
|
||||
def test_删除被业务引用的客户_400引导处理单据(
|
||||
self, client: TestClient, normal: dict
|
||||
) -> None:
|
||||
def test_删除被业务引用的客户_400引导处理单据(self, client: TestClient, normal: dict) -> None:
|
||||
"""业务表就位后删除保护补齐:FK RESTRICT 不能以 500 暴露。"""
|
||||
headers = normal["headers"]
|
||||
customer = _create_customer(client, headers)
|
||||
|
||||
@@ -235,7 +235,9 @@ class TestDeleteProtection:
|
||||
member = _create(client, headers, manager_id=manager["id"]) # 团队成员占用
|
||||
blocked = client.delete(f"{_PERSONNEL}/{manager['id']}", headers=headers)
|
||||
assert blocked.status_code == 400, blocked.text
|
||||
assert "存在团队成员、客户归属或业务归属引用,请改为离职而非删除" in blocked.json()["message"]
|
||||
assert (
|
||||
"存在团队成员、客户归属或业务归属引用,请改为离职而非删除" in blocked.json()["message"]
|
||||
)
|
||||
|
||||
client.delete(f"{_PERSONNEL}/{member['id']}", headers=headers)
|
||||
freed = client.delete(f"{_PERSONNEL}/{manager['id']}", headers=headers)
|
||||
@@ -261,7 +263,9 @@ class TestDeleteProtection:
|
||||
|
||||
blocked = client.delete(f"{_PERSONNEL}/{owner['id']}", headers=headers)
|
||||
assert blocked.status_code == 400, blocked.text
|
||||
assert "存在团队成员、客户归属或业务归属引用,请改为离职而非删除" in blocked.json()["message"]
|
||||
assert (
|
||||
"存在团队成员、客户归属或业务归属引用,请改为离职而非删除" in blocked.json()["message"]
|
||||
)
|
||||
|
||||
# 保护与在职状态无关:离职并不能让物理删除放行
|
||||
client.put(f"{_PERSONNEL}/{owner['id']}/status", json={"status": 0}, headers=headers)
|
||||
@@ -273,9 +277,7 @@ class TestDeleteProtection:
|
||||
freed = client.delete(f"{_PERSONNEL}/{owner['id']}", headers=headers)
|
||||
assert freed.status_code == 200, freed.text
|
||||
|
||||
def test_被业务归属引用禁删_负责或协助任一即拦(
|
||||
self, client: TestClient, normal: dict
|
||||
) -> None:
|
||||
def test_被业务归属引用禁删_负责或协助任一即拦(self, client: TestClient, normal: dict) -> None:
|
||||
"""业务表就位后删除保护补齐:负责/协助引用任一即拦,FK 不以 500 暴露。"""
|
||||
headers = normal["headers"]
|
||||
owner = _create(client, headers)
|
||||
|
||||
Reference in new issue
Block a user