def test_strptime(): import time string = '2004-12-01 13:02:47' format = '%Y-%m-%d %H:%M:%S' expected = datetime.datetime(*(time.strptime(string, format)[0:6])) got = datetime.datetime.strptime(string, format) assert expected == got
def test_repr(): print datetime expected = "datetime.datetime(1, 2, 3, 0, 0)" assert repr(datetime.datetime(1,2,3)) == expected
def test_repr(): print datetime expected = "datetime.datetime(1, 2, 3, 0, 0)" assert repr(datetime.datetime(1, 2, 3)) == expected