def test_content_should_be_purged_if_it_is_older_than_1_day(self): old_content = Content(url=some_url, body='old body', title='old title', lastmod = datetime.utcnow() - timedelta(days=1, minutes=1)) new_content = Content(url=some_url, body='new body', title='new title') old_content.put() new_content.put() Content.purge() kept_content = list(Content.all()) self.assertEqual(kept_content, [new_content])
def setUp(self): from pagefeed.models import Page, Content super(CleanDBTest, self).setUp() db.delete(Page.all()) db.delete(Content.all())
def all_contents(): return Content.all().fetch(5)