mirror of
https://github.com/GSA/notifications-api.git
synced 2026-02-04 18:31:13 -05:00
remove pytz remnants
This commit is contained in:
@@ -226,7 +226,7 @@ def get_scheduled_job_stats(service_id):
|
|||||||
jsonify(
|
jsonify(
|
||||||
count=count,
|
count=count,
|
||||||
soonest_scheduled_for=(
|
soonest_scheduled_for=(
|
||||||
soonest_scheduled_for.replace(tzinfo=ZoneInfo.UTC).isoformat()
|
soonest_scheduled_for.replace(tzinfo=ZoneInfo("UTC")).isoformat()
|
||||||
if soonest_scheduled_for
|
if soonest_scheduled_for
|
||||||
else None
|
else None
|
||||||
),
|
),
|
||||||
|
|||||||
@@ -12,5 +12,5 @@ def utc_string_to_aware_gmt_datetime(date):
|
|||||||
Returns an aware local datetime, essentially the time you'd see on your clock
|
Returns an aware local datetime, essentially the time you'd see on your clock
|
||||||
"""
|
"""
|
||||||
date = parser.parse(date)
|
date = parser.parse(date)
|
||||||
forced_utc = date.replace(tzinfo=ZoneInfo.UTC)
|
forced_utc = date.replace(tzinfo=ZoneInfo("UTC"))
|
||||||
return forced_utc.astimezone(local_timezone)
|
return forced_utc.astimezone(local_timezone)
|
||||||
|
|||||||
@@ -988,4 +988,4 @@ def admin_request(client):
|
|||||||
|
|
||||||
|
|
||||||
def datetime_in_past(days=0, seconds=0):
|
def datetime_in_past(days=0, seconds=0):
|
||||||
return datetime.now(tz=ZoneInfo.UTC) - timedelta(days=days, seconds=seconds)
|
return datetime.now(tz=ZoneInfo("UTC")) - timedelta(days=days, seconds=seconds)
|
||||||
|
|||||||
@@ -183,7 +183,7 @@ def test_create_scheduled_job(client, sample_template, mocker, fake_uuid):
|
|||||||
assert resp_json["data"]["id"] == fake_uuid
|
assert resp_json["data"]["id"] == fake_uuid
|
||||||
assert (
|
assert (
|
||||||
resp_json["data"]["scheduled_for"]
|
resp_json["data"]["scheduled_for"]
|
||||||
== datetime(2016, 1, 5, 11, 59, 0, tzinfo=ZoneInfo.UTC).isoformat()
|
== datetime(2016, 1, 5, 11, 59, 0, tzinfo=ZoneInfo("UTC")).isoformat()
|
||||||
)
|
)
|
||||||
assert resp_json["data"]["job_status"] == JobStatus.SCHEDULED
|
assert resp_json["data"]["job_status"] == JobStatus.SCHEDULED
|
||||||
assert resp_json["data"]["template"] == str(sample_template.id)
|
assert resp_json["data"]["template"] == str(sample_template.id)
|
||||||
|
|||||||
Reference in New Issue
Block a user