wip reporting
This commit is contained in:
31
order-events/tests/test_utils.py
Normal file
31
order-events/tests/test_utils.py
Normal 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),
|
||||
)
|
||||
Reference in New Issue
Block a user