fix: add active check post account platform update to prevent silent ignore by remote backend
This commit is contained in:
@@ -541,6 +541,7 @@ def test_organize_groups_corrects_mismatched_platform_instead_of_recreating(db_s
|
||||
|
||||
updated_accounts = []
|
||||
create_called = False
|
||||
mock_platform = "openai"
|
||||
|
||||
class MockClient:
|
||||
def __init__(self, **kwargs): pass
|
||||
@@ -554,7 +555,7 @@ def test_organize_groups_corrects_mismatched_platform_instead_of_recreating(db_s
|
||||
"id": "ACC-G1",
|
||||
"name": "SmartUp-G1",
|
||||
"group_ids": ["TG1"],
|
||||
"platform": "openai",
|
||||
"platform": mock_platform,
|
||||
}
|
||||
]
|
||||
def extract_id(self, val):
|
||||
@@ -564,7 +565,10 @@ def test_organize_groups_corrects_mismatched_platform_instead_of_recreating(db_s
|
||||
create_called = True
|
||||
return {"id": "NEW-ACC", "name": body["name"], "group_ids": body["group_ids"]}
|
||||
def update_account(self, account_id, body):
|
||||
nonlocal mock_platform
|
||||
updated_accounts.append((account_id, body))
|
||||
if "platform" in body:
|
||||
mock_platform = body["platform"]
|
||||
return {"id": account_id, "platform": body.get("platform")}
|
||||
|
||||
monkeypatch.setattr("app.routers.websites.Sub2ApiWebsiteClient", MockClient)
|
||||
|
||||
Reference in New Issue
Block a user