v0.2.0: CRM/ERP 系统升级 - 清理 .gitignore 并移除误提交的 venv/env/db 文件

- 更新 .gitignore:全面覆盖环境变量、数据库、日志、缓存、上传文件
- 移除误跟踪的 server/venv/、crm_data.db、.env 文件
- 新增 server/.env.example 模板
- 新增合同管理、利润核算、AI教练等功能模块
- 新增 Playwright e2e 测试套件
- 前后端多项功能升级和 bug 修复
This commit is contained in:
hankin
2026-05-11 07:24:19 +00:00
parent 0f4c6b7924
commit 815cbf9d8c
2526 changed files with 11875 additions and 804148 deletions
+24
View File
@@ -0,0 +1,24 @@
"""
Dashboard 统计测试 —— /api/dashboard
"""
import pytest
from httpx import AsyncClient
class TestDashboardStats:
"""GET /api/dashboard/stats"""
async def test_get_stats(self, client: AsyncClient, admin_headers):
"""工作台统计 → 200 + 有 4 个统计项"""
resp = await client.get("/api/dashboard/stats", headers=admin_headers)
assert resp.status_code == 200
data = resp.json()["data"]
assert "orders_count" in data
assert "pending_shipping" in data
assert "warning_skus" in data
assert "monthly_revenue" in data
async def test_stats_no_auth(self, client: AsyncClient, seed_data):
"""无认证 → 422"""
resp = await client.get("/api/dashboard/stats")
assert resp.status_code == 422