wip reporting

This commit is contained in:
2025-07-25 11:20:01 -03:00
parent 57cee90187
commit 5eae098098
15 changed files with 269 additions and 213 deletions

View File

@@ -0,0 +1,31 @@
from datetime import date
from utils import get_billing_period
def test_get_billing_period():
assert get_billing_period(billing_day=29, year=2025, month=2) == (
date(2025, 2, 28),
date(2025, 3, 28),
)
assert get_billing_period(billing_day=31, year=2025, month=2) == (
date(2025, 2, 28),
date(2025, 3, 30),
)
# Leap year
assert get_billing_period(billing_day=29, year=2028, month=2) == (
date(2028, 2, 29),
date(2028, 3, 28),
)
assert get_billing_period(billing_day=28, year=2025, month=2) == (
date(2025, 2, 28),
date(2025, 3, 27),
)
assert get_billing_period(billing_day=5, year=2025, month=12) == (
date(2025, 12, 5),
date(2026, 1, 4),
)