This commit is contained in:
@@ -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(
|
||||
|
||||
Reference in New Issue
Block a user