This commit is contained in:
@@ -12,6 +12,23 @@ def boot(client):
|
||||
return client.get("/api/v1/lists").json()[0]
|
||||
|
||||
|
||||
def test_bootstrap_returns_navigation_and_current_user(client):
|
||||
inbox = boot(client)
|
||||
client.post("/api/v1/folders", json={"name": "工作"})
|
||||
client.post("/api/v1/tags", json={"name": "重要", "color": "#ff0000"})
|
||||
client.post("/api/v1/tasks", json={"title": "首屏任务", "list_id": inbox["id"]})
|
||||
|
||||
response = client.get("/api/v1/bootstrap")
|
||||
|
||||
assert response.status_code == 200
|
||||
data = response.json()
|
||||
assert data["user"]["username"] == "owner"
|
||||
assert any(row["id"] == inbox["id"] for row in data["lists"])
|
||||
assert [row["name"] for row in data["folders"]] == ["工作"]
|
||||
assert [row["name"] for row in data["tags"]] == ["重要"]
|
||||
assert data["inbox_id"] == inbox["id"]
|
||||
|
||||
|
||||
def test_recurring_calendar_exceptions_and_scopes(client):
|
||||
inbox = boot(client)
|
||||
task = client.post(
|
||||
|
||||
Reference in New Issue
Block a user