fix(tests): Testdaten für Jahreswechsel-Regressionstest korrigieren
01.01.2028 war ein Samstag – zählt schon als Wochenende, testete den Fix damit nicht wirklich. 2028/2029-Grenze (Neujahr = Montag) verwendet. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015Ahyx6D3r7G1EuAc42nezn
This commit is contained in:
@@ -522,20 +522,21 @@ async def test_holiday_dates_cover_year_boundary(
|
|||||||
assert r.status_code == 200, r.text
|
assert r.status_code == 200, r.text
|
||||||
|
|
||||||
await db_session.execute(text("SET LOCAL app.bypass_rls = 'on'"))
|
await db_session.execute(text("SET LOCAL app.bypass_rls = 'on'"))
|
||||||
await ensure_holidays_for_year(2027, "BY", db_session)
|
|
||||||
await ensure_holidays_for_year(2028, "BY", db_session)
|
await ensure_holidays_for_year(2028, "BY", db_session)
|
||||||
|
await ensure_holidays_for_year(2029, "BY", db_session)
|
||||||
await db_session.commit()
|
await db_session.commit()
|
||||||
|
|
||||||
# Di 28.12.2027 - Sa 01.01.2028: Wochentage Di/Mi/Do/Fr (29./30./31.12., 01.01.),
|
# Do 28.12.2028 - Mo 01.01.2029: Wochentage Do/Fr (28./29.12.) + Mo (01.01.),
|
||||||
# davon Neujahr (01.01.2028) ein Feiertag -> 3 Werktage
|
# Sa/So (30./31.12.) fallen ohnehin raus. Montag 01.01.2029 ist Neujahr
|
||||||
start = date(2027, 12, 28)
|
# (Feiertag) -> 2 Werktage.
|
||||||
end = date(2028, 1, 1)
|
start = date(2028, 12, 28)
|
||||||
|
end = date(2029, 1, 1)
|
||||||
resp = await client.post("/api/v1/absences/", json={
|
resp = await client.post("/api/v1/absences/", json={
|
||||||
"type_id": str(cov_vacation_type_id), "start_date": str(start), "end_date": str(end),
|
"type_id": str(cov_vacation_type_id), "start_date": str(start), "end_date": str(end),
|
||||||
}, headers=cov_headers)
|
}, headers=cov_headers)
|
||||||
assert resp.status_code == 201, resp.text
|
assert resp.status_code == 201, resp.text
|
||||||
data = resp.json()
|
data = resp.json()
|
||||||
assert data["working_days"] == 3, (
|
assert data["working_days"] == 2, (
|
||||||
f"Neujahr (Folgejahr) muss aus working_days herausgerechnet werden, "
|
f"Neujahr (Folgejahr) muss aus working_days herausgerechnet werden, "
|
||||||
f"got {data['working_days']}"
|
f"got {data['working_days']}"
|
||||||
)
|
)
|
||||||
|
|||||||
Reference in New Issue
Block a user