feat: improve app ui and project metadata
This commit is contained in:
@@ -158,8 +158,11 @@ async def test_list_projects() -> None:
|
||||
await client.post("/projects", json={"title": "乙"})
|
||||
resp = await client.get("/projects")
|
||||
assert resp.status_code == 200
|
||||
titles = {p["title"] for p in resp.json()["projects"]}
|
||||
projects = resp.json()["projects"]
|
||||
titles = {p["title"] for p in projects}
|
||||
assert titles == {"甲", "乙"}
|
||||
assert all("updated_at" in p for p in projects)
|
||||
assert all(p["pending_review_count"] == 0 for p in projects)
|
||||
|
||||
|
||||
@pytest.mark.asyncio
|
||||
@@ -169,7 +172,10 @@ async def test_get_project_detail() -> None:
|
||||
created = (await client.post("/projects", json={"title": "详情"})).json()
|
||||
resp = await client.get(f"/projects/{created['id']}")
|
||||
assert resp.status_code == 200
|
||||
assert resp.json()["title"] == "详情"
|
||||
body = resp.json()
|
||||
assert body["title"] == "详情"
|
||||
assert "updated_at" in body
|
||||
assert body["pending_review_count"] == 0
|
||||
|
||||
|
||||
@pytest.mark.asyncio
|
||||
|
||||
Reference in New Issue
Block a user