Пример #1
0
 def test_not_future_dates(self):
     all_past_dates = [
         timedelta(seconds=1),
         timedelta(minutes=1),
         timedelta(days=1),
     ]
     for past_date in all_past_dates:
         self.assertFalse(utils.future_date(timezone.now() - past_date))
Пример #2
0
 def test_future_date(self):
     all_future_dates = [
         timedelta(seconds=1),
         timedelta(minutes=1),
         timedelta(days=1),
     ]
     for future_date in all_future_dates:
         self.assertTrue(utils.future_date(timezone.now() + future_date))