Extracted from /home/wizard/code monorepo into its own repo so Woodpecker CI can watch it. Identical content to /home/wizard/code commit e426028. See README.md for overview, env vars, and Paperless workflow config. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
22 lines
595 B
Python
22 lines
595 B
Python
from datetime import date
|
|
|
|
import pytest
|
|
|
|
from payslip_ingest.tax_year import derive_tax_year
|
|
|
|
|
|
@pytest.mark.parametrize(
|
|
("pay_date", "expected"),
|
|
[
|
|
(date(2025, 4, 5), "2024/25"),
|
|
(date(2025, 4, 6), "2025/26"),
|
|
(date(2026, 4, 5), "2025/26"),
|
|
(date(2026, 4, 6), "2026/27"),
|
|
(date(2026, 12, 31), "2026/27"),
|
|
(date(2027, 1, 1), "2026/27"),
|
|
(date(2027, 4, 5), "2026/27"),
|
|
(date(2027, 4, 6), "2027/28"),
|
|
],
|
|
)
|
|
def test_derive_tax_year(pay_date: date, expected: str) -> None:
|
|
assert derive_tax_year(pay_date) == expected
|