def index(page): recent_posts = Post.get_recent(page) return render_template('general/index.html', posts=recent_posts)
def test_get_recent(self): post = self.create_post() self.assertEqual(len(Post.get_recent(1).items), 0) post.publish() self.assertEqual(len(Post.get_recent(1).items), 1)