def test_datetime_date(): expected = datetime.date(1987, 6, 5) dt = dateutils.datetime(1987, 6, 5, 4, 3, 2, 1, None) assert expected == dt.date()
def test_datetime_creation_before_1900(): expected = datetime.datetime(1765, 1, 3, 10, 2, 13) result = dateutils.datetime(1765, 1, 3, 10, 2, 13) assert expected == result
def test_datetime_strftime_before_1900(): new_datetime = dateutils.datetime(1765, 1, 3, 10, 2, 13) expected = "Thu, 03 Jan 1765 10:02:13 +0000" result = new_datetime.strftime("%a, %d %b %Y %H:%M:%S +0000") assert expected == result
def test_datetime_creation_after_1900(): expected = datetime.datetime(1908, 3, 12, 12, 12, 12) result = dateutils.datetime(1908, 3, 12, 12, 12, 12) assert expected == result