mirror of
https://github.com/GSA/notifications-api.git
synced 2026-05-04 00:00:27 -04:00
Bump notifications-utils to 3.7.0
Bumped notifications-utils to 3.7.0. Version 3.7.0 includes the `convert_utc_to_bst` and `convert_bst_to_utc` functions and the `LETTER_PROCESSING_DEADLINE` constant, so these have been removed from this repo and anywhere using these has now been updated to get these from `notifications-utils`. Also bumped pytest by a patch version to bring in a bug fix.
This commit is contained in:
@@ -6,8 +6,6 @@ from freezegun import freeze_time
|
||||
from app.utils import (
|
||||
get_london_midnight_in_utc,
|
||||
get_midnight_for_day_before,
|
||||
convert_utc_to_bst,
|
||||
convert_bst_to_utc,
|
||||
midnight_n_days_ago,
|
||||
last_n_days
|
||||
)
|
||||
@@ -31,26 +29,6 @@ def test_get_midnight_for_day_before_returns_expected_date(date, expected_date):
|
||||
assert get_midnight_for_day_before(date) == expected_date
|
||||
|
||||
|
||||
@pytest.mark.parametrize('date, expected_date', [
|
||||
(datetime(2017, 3, 26, 23, 0), datetime(2017, 3, 27, 0, 0)), # 2017 BST switchover
|
||||
(datetime(2017, 3, 20, 23, 0), datetime(2017, 3, 20, 23, 0)),
|
||||
(datetime(2017, 3, 28, 10, 0), datetime(2017, 3, 28, 11, 0)),
|
||||
(datetime(2017, 10, 28, 1, 0), datetime(2017, 10, 28, 2, 0)),
|
||||
(datetime(2017, 10, 29, 1, 0), datetime(2017, 10, 29, 1, 0)),
|
||||
(datetime(2017, 5, 12, 14), datetime(2017, 5, 12, 15, 0))
|
||||
])
|
||||
def test_get_utc_in_bst_returns_expected_date(date, expected_date):
|
||||
ret_date = convert_utc_to_bst(date)
|
||||
assert ret_date == expected_date
|
||||
|
||||
|
||||
def test_convert_bst_to_utc():
|
||||
bst = "2017-05-12 13:15"
|
||||
bst_datetime = datetime.strptime(bst, "%Y-%m-%d %H:%M")
|
||||
utc = convert_bst_to_utc(bst_datetime)
|
||||
assert utc == datetime(2017, 5, 12, 12, 15)
|
||||
|
||||
|
||||
@pytest.mark.parametrize('current_time, arg, expected_datetime', [
|
||||
# winter
|
||||
('2018-01-10 23:59', 1, datetime(2018, 1, 9, 0, 0)),
|
||||
|
||||
Reference in New Issue
Block a user