fix: 清掉无用接口和样式,并收紧登录与工号边界

This commit is contained in:
2026-11-16 11:30:59 +08:00
parent 7381b49e4c
commit 5b83b7e415
15 changed files with 232 additions and 329 deletions
-1
View File
@@ -25,7 +25,6 @@ def fresh_database():
with engine.begin() as connection:
connection.execute(text("DROP TABLE IF EXISTS accounts"))
connection.execute(text("DROP TABLE IF EXISTS schedules"))
connection.execute(text("DROP TABLE IF EXISTS system_config"))
connection.execute(text("DROP TABLE IF EXISTS courses"))
connection.execute(text("DROP TABLE IF EXISTS course_sync"))
+2 -2
View File
@@ -430,7 +430,7 @@ def test_paused_account_still_updates_when_opening_home() -> None:
super().__init__(login_name, password)
self._token = "yxt-1"
def home_snapshot(self) -> dict:
def home_summary(self) -> dict:
self._token = "yxt-2"
return {"name": "测试用户"}
@@ -440,7 +440,7 @@ def test_paused_account_still_updates_when_opening_home() -> None:
return exported
with SessionLocal() as db:
assert service.fetch_home(db, "paused-user", HomeClient)["name"] == "测试用户"
assert service.fetch_home_summary(db, "paused-user", HomeClient)["name"] == "测试用户"
account = db.get(Account, "paused-user")
assert account is not None
assert account.refresh_paused is True
+1 -5
View File
@@ -579,14 +579,10 @@ def test_user_can_set_proxy_with_or_without_password() -> None:
account = db.get(Account, "6650000146")
assert account is not None
assert decrypt_secret(account.proxy_password_cipher) == "p@ss"
cleared = client.delete("/api/settings/proxy")
cleared = client.put("/api/settings/proxy", json={"scheme": "off"})
assert cleared.status_code == 200
assert cleared.json()["enabled"] is False
assert cleared.json()["scheme"] == "off"
off = client.put("/api/settings/proxy", json={"scheme": "off"})
assert off.status_code == 200
assert off.json()["enabled"] is False
assert off.json()["scheme"] == "off"
def test_user_can_set_course_workers() -> None:
+1 -2
View File
@@ -25,7 +25,6 @@ def test_study_push_throttles_and_only_sends_latest(monkeypatch) -> None:
study_push._dirty.clear()
study_push._urgent.clear()
study_push._last_flush.clear()
study_push._latest.clear()
study_push._clients.clear()
study_push.attach_loop(asyncio.get_running_loop())
study_push.register("u1", socket)
@@ -39,7 +38,7 @@ def test_study_push_throttles_and_only_sends_latest(monkeypatch) -> None:
study_push.notify("u1", urgent=True)
await asyncio.sleep(0.05)
assert len(socket.payloads) == 2
assert study_push.latest_of("u1") == socket.payloads[-1]
assert socket.payloads[-1]["eid"] == "u1"
finally:
for handle in list(study_push._pending.values()):
handle.cancel()