fix: 后端路由 group_id 启用 path 路径匹配转换器,完美兼容带斜杠的远端分组 ID

This commit is contained in:
liumangmang
2026-07-01 17:58:56 +08:00
parent 3172ab18bf
commit ef14382e5f
2 changed files with 5 additions and 5 deletions
+4 -4
View File
@@ -42,7 +42,7 @@ def test_create_and_update_website_group(db_session, monkeypatch):
b = WebsiteGroupBinding(
website_id=w.id,
target_group_id="g123",
target_group_id="g/123",
target_group_name="OldName",
source_groups_json="[]",
enabled=True
@@ -81,12 +81,12 @@ def test_create_and_update_website_group(db_session, monkeypatch):
# 2. Test update_website_group
body_update = WebsiteGroupUpdate(name="UpdatedGroup", description="UpdatedDesc")
res_update = update_website_group(wid=w.id, group_id="g123", body=body_update, db=db_session)
assert res_update["id"] == "g123"
res_update = update_website_group(wid=w.id, group_id="g/123", body=body_update, db=db_session)
assert res_update["id"] == "g/123"
assert res_update["name"] == "UpdatedGroup"
assert res_update["description"] == "UpdatedDesc"
assert len(called_update) == 1
assert called_update[0][1] == "g123"
assert called_update[0][1] == "g/123"
assert called_update[0][2] == {"name": "UpdatedGroup", "description": "UpdatedDesc"}
# Verify that local binding was updated