def test_pretty_date(self): time=datetime.datetime.now() delta=datetime.timedelta(0, -5) self.assertEqual(datetime_helper.pretty_date(time+delta), "just now") later_delta=datetime.timedelta(0, 10) self.assertRaises(Exception, 'Thought appears to be from the future', datetime_helper.pretty_date, time+delta)
def pretty_date(self): return datetime_helper.pretty_date(self.datetime)