2017-10-26 11:49:56 +01:00
|
|
|
from freezegun import freeze_time
|
|
|
|
|
|
2023-06-14 13:19:11 -07:00
|
|
|
from app.dao.date_util import get_current_calendar_year_start_year
|
2021-03-10 13:55:06 +00:00
|
|
|
|
2017-10-26 11:49:56 +01:00
|
|
|
|
|
|
|
|
# see get_financial_year for conversion of financial years.
|
2023-05-10 08:39:50 -07:00
|
|
|
@freeze_time("2017-03-31 23:59:59.999999")
|
2023-06-14 13:19:11 -07:00
|
|
|
def test_get_current_calendar_year_start_year_before_march():
|
|
|
|
|
current_fy = get_current_calendar_year_start_year()
|
|
|
|
|
assert current_fy == 2017
|
2017-10-26 11:49:56 +01:00
|
|
|
|
|
|
|
|
|
2022-11-10 16:54:48 -05:00
|
|
|
@freeze_time("2017-04-01 04:00:00.000000")
|
2023-06-14 13:19:11 -07:00
|
|
|
def test_get_current_calendar_year_start_year_after_april():
|
|
|
|
|
current_fy = get_current_calendar_year_start_year()
|
2017-10-26 13:25:11 +01:00
|
|
|
assert current_fy == 2017
|