def test_format_like_with_date(self): cur = datetime.date(2010, 10, 10) curstr = cur.strftime("%B %d, %Y") formatted = format_like(cur, "March 19, 2010") self.assertEqual(curstr, formatted)
def test_format_like_with_time(self): cur = datetime.time(12, 02, 02) curstr = cur.strftime("%I:%M:%S %p") formatted = format_like(cur, "10:10:10 am") self.assertEqual(curstr, formatted)
def test_format_like_with_datetime(self): cur = datetime.datetime.utcnow() curstr = cur.strftime("%B %d, %Y %I:%M %p") formatted = format_like(cur, "March 19, 2010 01:00 am") self.assertEqual(curstr, formatted)