def test_same_posts_and_max(self, make_feed_context): self.app.config.rss_max_items = len(self.app.builder.env.blog_posts) # Call the mocked function for creating the feed context and # verify the number of items it contains. list(rss.generate_feed(self.app)) make_feed_context.assert_called_once_with( self.app, None, self.app.builder.env.blog_posts, )
def collect_additional_pages(app): ''' Generates additional pages. ''' for name, context, template in rss.generate_feed(app): yield (name, context, template) for name, context, template in filing.make_tag_pages(app): yield (name, context, template) for name, context, template in filing.make_category_pages(app): yield (name, context, template) for name, context, template in aggregator.make_aggregated_pages(app): yield (name, context, template) for name, context, template in filing.make_archive(app): yield (name, context, template)
def test_no_posts(self, make_feed_context): make_feed_context.side_effect = AssertionError('should not be called') self.app.builder.env.blog_posts = [] list(rss.generate_feed(self.app))