feat: add custom task recurrence options
ci / docker (push) Successful in 5m27s

This commit is contained in:
2026-09-08 08:53:02 +08:00
parent 2eca978820
commit 0dd67f2824
5 changed files with 35 additions and 3 deletions
+23
View File
@@ -29,6 +29,29 @@ def test_bootstrap_returns_navigation_and_current_user(client):
def test_creating_task_with_recurrence_is_atomic(client):
inbox = boot(client)
created = client.post(
"/api/v1/tasks",
json={
"title": "隔周复盘",
"list_id": inbox["id"],
"due_at": "2026-09-07T09:00:00Z",
"rrule": "FREQ=WEEKLY;INTERVAL=2;BYDAY=MO,FR",
},
)
assert created.status_code == 201
recurrence = client.get(f"/api/v1/tasks/{created.json()['id']}/recurrence").json()
assert recurrence["rrule"] == "FREQ=WEEKLY;INTERVAL=2;BYDAY=MO,FR"
rejected = client.post(
"/api/v1/tasks",
json={"title": "缺少日期", "list_id": inbox["id"], "rrule": "FREQ=DAILY"},
)
assert rejected.status_code == 422
assert client.get("/api/v1/tasks", params={"q": "缺少日期"}).json()["items"] == []
def test_custom_recurrence_rejects_invalid_weekdays_month_days_and_until(client):
inbox = boot(client)
task = client.post(