def test_future(self): """Test behavior when date is in the future and also when omitting the `now` kwarg.""" eq_('', timesince(datetime(9999, 1, 2)))
def test_none(self): """If None is passed in, timesince returns ''.""" eq_('', timesince(None))
def test_trunc(self): """Assert it returns only the most significant time division.""" eq_('1 year ago', timesince(datetime(2000, 1, 2), now=datetime(2001, 2, 3)))
def utctimesince(time, now=None): now = now or datetime.utcnow() return timesince(time, now)