tz utility swap and many test updates

This commit is contained in:
stvnrlly
2022-11-10 12:33:25 -05:00
parent 929b641e2f
commit b50cb4712f
38 changed files with 351 additions and 343 deletions

View File

@@ -20,7 +20,7 @@ from app.models import UK_POSTAGE_TYPES
from app.platform_stats.platform_stats_schema import platform_stats_request
from app.schema_validation import validate
from app.service.statistics import format_admin_stats
from app.utils import get_london_midnight_in_utc
from app.utils import get_local_midnight_in_utc
platform_stats_blueprint = Blueprint('platform_stats', __name__)
@@ -57,8 +57,8 @@ def validate_date_range_is_within_a_financial_year(start_date, end_date):
if end_date < start_date:
raise InvalidRequest(message="Start date must be before end date", status_code=400)
start_fy = get_financial_year_for_datetime(get_london_midnight_in_utc(start_date))
end_fy = get_financial_year_for_datetime(get_london_midnight_in_utc(end_date))
start_fy = get_financial_year_for_datetime(get_local_midnight_in_utc(start_date))
end_fy = get_financial_year_for_datetime(get_local_midnight_in_utc(end_date))
if start_fy != end_fy:
raise InvalidRequest(message="Date must be in a single financial year.", status_code=400)