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