homepage
This commit is contained in:
@@ -153,6 +153,24 @@ async def test_history_recorded(client):
|
||||
assert history[0]["ip"] == "192.168.1.5"
|
||||
|
||||
|
||||
async def test_homepage_stats(client):
|
||||
await client.post("/api/notes", json={"body": "note one"})
|
||||
await client.post("/api/notes", json={"body": "note two"})
|
||||
await client.post(
|
||||
"/api/attachments",
|
||||
files={"file": ("a.png", b"abc", "image/png")},
|
||||
data={"username": "schmeeve"},
|
||||
)
|
||||
|
||||
r = await client.get("/api/homepage")
|
||||
assert r.status_code == 200
|
||||
stats = r.json()
|
||||
assert stats["total_notes"] == 2
|
||||
assert stats["attachments"] == 1
|
||||
assert stats["actions"] == 2
|
||||
assert stats["users"] == 3
|
||||
|
||||
|
||||
async def test_user_selection_cookie(client):
|
||||
r = await client.post("/api/users/select", json={"username": "ilya"})
|
||||
assert r.status_code == 200
|
||||
|
||||
Reference in New Issue
Block a user