fix(todos): Literal types pour status/priority/days, Field default_factory pour tags

This commit is contained in:
2026-05-24 09:17:39 +02:00
parent 3591972014
commit 861f6497bb
2 changed files with 18 additions and 17 deletions
+10 -10
View File
@@ -47,8 +47,8 @@ async def test_lister_todos_filtre_domaine(client):
async def test_mettre_a_jour_todo(client):
cr = await client.post("/api/todos/", json={"title": "TEST_avant"})
item_id = cr.json()["id"]
create_resp = await client.post("/api/todos/", json={"title": "TEST_avant"})
item_id = create_resp.json()["id"]
resp = await client.patch(f"/api/todos/{item_id}", json={"title": "TEST_après", "status": "done"})
assert resp.status_code == 200
@@ -66,8 +66,8 @@ async def test_mettre_a_jour_todo_inexistant(client):
async def test_supprimer_todo(client):
cr = await client.post("/api/todos/", json={"title": "TEST_à supprimer"})
item_id = cr.json()["id"]
create_resp = await client.post("/api/todos/", json={"title": "TEST_à supprimer"})
item_id = create_resp.json()["id"]
resp = await client.delete(f"/api/todos/{item_id}")
assert resp.status_code == 204
@@ -78,8 +78,8 @@ async def test_supprimer_todo(client):
async def test_reporter_todo_1_jour(client):
due = "2026-06-01T10:00:00+00:00"
cr = await client.post("/api/todos/", json={"title": "TEST_reporter", "due_date": due})
item_id = cr.json()["id"]
create_resp = await client.post("/api/todos/", json={"title": "TEST_reporter", "due_date": due})
item_id = create_resp.json()["id"]
resp = await client.post(f"/api/todos/{item_id}/postpone", json={"days": 1})
assert resp.status_code == 200
@@ -90,8 +90,8 @@ async def test_reporter_todo_1_jour(client):
async def test_reporter_todo_1_semaine(client):
due = "2026-06-01T10:00:00+00:00"
cr = await client.post("/api/todos/", json={"title": "TEST_reporter7", "due_date": due})
item_id = cr.json()["id"]
create_resp = await client.post("/api/todos/", json={"title": "TEST_reporter7", "due_date": due})
item_id = create_resp.json()["id"]
resp = await client.post(f"/api/todos/{item_id}/postpone", json={"days": 7})
assert resp.status_code == 200
@@ -101,8 +101,8 @@ async def test_reporter_todo_1_semaine(client):
async def test_reporter_jours_invalides(client):
cr = await client.post("/api/todos/", json={"title": "TEST_invalide"})
item_id = cr.json()["id"]
create_resp = await client.post("/api/todos/", json={"title": "TEST_invalide"})
item_id = create_resp.json()["id"]
resp = await client.post(f"/api/todos/{item_id}/postpone", json={"days": 3})
assert resp.status_code == 422