Sprint 6: report review workflow, CI/K8s, and client tabs.
Add coach review APIs, pose calibration thresholds, Gitea CI, Kubernetes skeleton, H5 practice page, and mini program tab bar. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -44,3 +44,36 @@ def auth_headers(client):
|
||||
assert resp.status_code == 200, resp.text
|
||||
token = resp.json()["data"]["token"]
|
||||
return {"Authorization": f"Bearer {token}"}
|
||||
|
||||
|
||||
@pytest.fixture()
|
||||
def staff_headers(client, db_session):
|
||||
from sqlalchemy import select
|
||||
|
||||
from app.core.security import hash_phone
|
||||
from app.db.models import User
|
||||
|
||||
resp = client.post(
|
||||
"/api/auth/login",
|
||||
json={"loginType": "phone_code", "credential": "18600000001", "code": "682139"},
|
||||
)
|
||||
assert resp.status_code == 200, resp.text
|
||||
token = resp.json()["data"]["token"]
|
||||
user = db_session.scalar(select(User).where(User.phone_hash == hash_phone("18600000001")))
|
||||
if user:
|
||||
user.role = "coach"
|
||||
db_session.commit()
|
||||
return {"Authorization": f"Bearer {token}"}
|
||||
|
||||
|
||||
@pytest.fixture()
|
||||
def db_session(client):
|
||||
gen = app.dependency_overrides[get_db]()
|
||||
db = next(gen)
|
||||
try:
|
||||
yield db
|
||||
finally:
|
||||
try:
|
||||
next(gen)
|
||||
except StopIteration:
|
||||
pass
|
||||
|
||||
Reference in New Issue
Block a user