time adjustments in tests

This commit is contained in:
stvnrlly
2022-11-14 14:23:54 -05:00
parent 3528bd37e1
commit 213f699c99
7 changed files with 25 additions and 17 deletions

View File

@@ -2,7 +2,10 @@ from datetime import date, datetime, time, timedelta
from os import getenv
import pytz
from notifications_utils.timezones import convert_local_timezone_to_utc, convert_utc_to_local_timezone
from notifications_utils.timezones import (
convert_local_timezone_to_utc,
convert_utc_to_local_timezone,
)
def get_months_for_financial_year(year):
@@ -47,8 +50,8 @@ def get_april_fools(year):
:param year: the year to calculate the April 1, 00:00 BST for
:return: the datetime of April 1 for the given year, for example 2016 = 2016-03-31 23:00:00
"""
return pytz.timezone(getenv("TIMEZONE", "America/New_York")).localize(datetime(year, 4, 1, 0, 0, 0)).astimezone(pytz.UTC).replace(
tzinfo=None)
return pytz.timezone(getenv("TIMEZONE", "America/New_York")).localize(
datetime(year, 4, 1, 0, 0, 0)).astimezone(pytz.UTC).replace(tzinfo=None)
def get_month_start_and_end_date_in_utc(month_year):