示例#1
0
 def test_was_published_not_recently(self):
     old_article = Article("21255", pub_date=timezone.now() - datetime.timedelta(days=30),
                           author=self.joe)
     self.assertEqual(old_article.was_published_recently(), False)
示例#2
0
 def test_was_published_recently(self):
     recent_article = Article("21255", pub_date=timezone.now() - datetime.timedelta(hours=1),
                              author=self.joe)
     self.assertEqual(recent_article.was_published_recently(), True)
示例#3
0
 def test_was_published_with_future_date(self):
     future_article = Article("21255", pub_date=timezone.now() + datetime.timedelta(days=30),
                              author=self.joe)
     self.assertEqual(future_article.was_published_recently(), False)
示例#4
0
 def test_was_published_not_recently(self):
     old_article = Article("21255",
                           pub_date=timezone.now() -
                           datetime.timedelta(days=30),
                           author=self.joe)
     self.assertEqual(old_article.was_published_recently(), False)
示例#5
0
 def test_was_published_recently(self):
     recent_article = Article("21255",
                              pub_date=timezone.now() -
                              datetime.timedelta(hours=1),
                              author=self.joe)
     self.assertEqual(recent_article.was_published_recently(), True)
示例#6
0
 def test_was_published_with_future_date(self):
     future_article = Article("21255",
                              pub_date=timezone.now() +
                              datetime.timedelta(days=30),
                              author=self.joe)
     self.assertEqual(future_article.was_published_recently(), False)