Ejemplo n.º 1
0
 def test_tomorrow(self):
     assert "tomorrow" == friendly_display(datetime.now() + timedelta(days=1))
Ejemplo n.º 2
0
 def test_2_hours(self):
     assert "in 2 hours" == friendly_display(datetime.now() + timedelta(hours=2))
Ejemplo n.º 3
0
 def test_now(self):
     assert "now" == friendly_display(datetime.now())
Ejemplo n.º 4
0
 def test_1_hour_10_minutes(self):
     assert "in an hour" == friendly_display(datetime.now() + timedelta(hours=1, minutes=10))
Ejemplo n.º 5
0
 def test_1_hour_45_minutes(self):
     assert "in 2 hours" == friendly_display(datetime.now() + timedelta(hours=1, minutes=45))
Ejemplo n.º 6
0
 def test_1_hour(self):
     assert "in an hour" == friendly_display(datetime.now() + timedelta(hours=1))
Ejemplo n.º 7
0
 def test_45_minutes(self):
     assert "in 45 minutes" == friendly_display(datetime.now() + timedelta(minutes=45))
Ejemplo n.º 8
0
 def test_10_minutes(self):
     assert "in 10 minutes" == friendly_display(datetime.now() + timedelta(minutes=10))
Ejemplo n.º 9
0
 def test_3_days(self):
     assert "in 3 days" == friendly_display(datetime.now() + timedelta(days=3))
Ejemplo n.º 10
0
 def tasks_by_expiration(self):
     for note in self.notes:
         note.expires = self._task_expiration_date(note)
         note.expires_display = date.friendly_display(note.expires)
     return sorted(self.notes, cmp=lambda x, y: cmp(x.expires, y.expires))