示例#1
0
 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,
     )
示例#2
0
 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,
     )
示例#3
0
文件: blog.py 项目: scudette/tinkerer
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)
示例#4
0
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)
示例#5
0
 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))
示例#6
0
 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))