fix: backend improvements (customer health, tests, middleware, corpus)

This commit is contained in:
wlt
2026-06-24 10:38:26 +08:00
parent eb39cc1baa
commit ad329815fa
11 changed files with 122 additions and 77 deletions
+5 -6
View File
@@ -27,8 +27,7 @@ class TestAdminAPI:
)
assert response.status_code == 200
data = response.json()
assert "total_users" in data
assert "paid_users" in data
assert data["users"]["total"] >= 1
async def test_admin_list_users(self, client: AsyncClient, test_user):
test_user.role = "admin"
@@ -81,15 +80,15 @@ class TestPrivacyTerms:
async def test_privacy_page_exists(self):
import os
path = os.path.join(
os.path.dirname(os.path.dirname(os.path.abspath(__file__))),
os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))),
"uni-app", "src", "pages", "agreement", "privacy.vue",
)
assert os.path.exists(path), "privacy.vue not found"
assert os.path.exists(path), f"privacy.vue not found at {path}"
async def test_terms_page_exists(self):
import os
path = os.path.join(
os.path.dirname(os.path.dirname(os.path.abspath(__file__))),
os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))),
"uni-app", "src", "pages", "agreement", "terms.vue",
)
assert os.path.exists(path), "terms.vue not found"
assert os.path.exists(path), f"terms.vue not found at {path}"