Exemplo n.º 1
0
Arquivo: tests.py Projeto: TJLW/TAFF-E
 def test_was_published_recently_with_old_question(self):
     """
     was_added_recently() should return False for lists whose
     add_date is older than 1 day.
     """
     time = timezone.now() - datetime.timedelta(days=30)
     old_list = Lists(add_date=time)
     self.assertEqual(old_list.was_added_recently(), False)
Exemplo n.º 2
0
Arquivo: tests.py Projeto: TJLW/TAFF-E
 def test_was_published_recently_with_recent_question(self):
     """
     was_added_recently() should return True for lists whose
     add_date is within the last day.
     """
     time = timezone.now() - datetime.timedelta(hours=1)
     recent_list = Lists(add_date=time)
     self.assertEqual(recent_list.was_added_recently(), True)
Exemplo n.º 3
0
Arquivo: tests.py Projeto: TJLW/TAFF-E
 def test_was_added_recently_with_future_list(self):
     """
     was_added_recently() should return False for lists whose
     add_date is in the future.
     """
     time = timezone.now() + datetime.timedelta(days=30)
     future_list = Lists(add_date=time)
     self.assertEqual(future_list.was_added_recently(), False)