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])
예제 #2
0
파일: cron.py 프로젝트: timbertson/pagefeed
	def get(self):
		assert users.is_current_user_admin()
		logging.info("purging old content entries")
		Content.purge()
		logging.info("finished purging old content entries")
		self.response.out.write("ok")