def test_str2date():
# GIVEN
expected = datetime(
year=2017,
month=3,
day=21,
hour=16,
minute=9,
second=13,
tzinfo=timezone(timedelta(hours=1))
)
string = '2017-03-21 16:09:13 +0100'
# WHEN
date = datetools.str2date(string)
# THEN
assert date == expected
评论列表
文章目录