add tests for get_london_midnight_in_utc with a date object

we sometimes call it with a timestamp, but sometimes with just a date
object. It works with both, lets add the tests to prove that
This commit is contained in:
Leo Hemsted
2019-04-02 11:52:37 +01:00
parent 3739d9055d
commit f1b3ae553f

View File

@@ -1,4 +1,4 @@
from datetime import datetime
from datetime import datetime, date
import pytest
from freezegun import freeze_time
@@ -15,6 +15,9 @@ from app.utils import (
(datetime(2016, 1, 15, 0, 30), datetime(2016, 1, 15, 0, 0)),
(datetime(2016, 6, 15, 0, 0), datetime(2016, 6, 14, 23, 0)),
(datetime(2016, 9, 15, 11, 59), datetime(2016, 9, 14, 23, 0)),
# works for both dates and datetimes
(date(2016, 1, 15), datetime(2016, 1, 15, 0, 0)),
(date(2016, 6, 15), datetime(2016, 6, 14, 23, 0)),
])
def test_get_london_midnight_in_utc_returns_expected_date(date, expected_date):
assert get_london_midnight_in_utc(date) == expected_date