comparison tests/test_templating_jinjaengine.py @ 711:ab5c6a8ae90a

bake: Replace hard-coded taxonomy support with "generator" system. * Taxonomies are now implemented one or more `TaxonomyGenerator`s. * A `BlogArchivesGenerator` stub is there but non-functional.
author Ludovic Chabant <ludovic@chabant.com>
date Thu, 26 May 2016 19:52:47 -0700
parents 55026b7bb1bf
children 72f17534d58e
comparison
equal deleted inserted replaced
710:e85f29b28b84 711:ab5c6a8ae90a
26 .withConfig(app_config) 26 .withConfig(app_config)
27 .withPage('pages/foo', config=page_config, contents=contents)) 27 .withPage('pages/foo', config=page_config, contents=contents))
28 with mock_fs_scope(fs, open_patches=open_patches): 28 with mock_fs_scope(fs, open_patches=open_patches):
29 app = fs.getApp() 29 app = fs.getApp()
30 page = get_simple_page(app, 'foo.md') 30 page = get_simple_page(app, 'foo.md')
31 route = app.getRoute('pages', None) 31 route = app.getSourceRoute('pages', None)
32 route_metadata = {'slug': 'foo'} 32 route_metadata = {'slug': 'foo'}
33 output = render_simple_page(page, route, route_metadata) 33 output = render_simple_page(page, route, route_metadata)
34 assert output == expected 34 assert output == expected
35 35
36 36
44 .withPage('pages/foo', config={'layout': 'blah'}, 44 .withPage('pages/foo', config={'layout': 'blah'},
45 contents=contents)) 45 contents=contents))
46 with mock_fs_scope(fs, open_patches=open_patches): 46 with mock_fs_scope(fs, open_patches=open_patches):
47 app = fs.getApp() 47 app = fs.getApp()
48 page = get_simple_page(app, 'foo.md') 48 page = get_simple_page(app, 'foo.md')
49 route = app.getRoute('pages', None) 49 route = app.getSourceRoute('pages', None)
50 route_metadata = {'slug': 'foo'} 50 route_metadata = {'slug': 'foo'}
51 output = render_simple_page(page, route, route_metadata) 51 output = render_simple_page(page, route, route_metadata)
52 assert output == expected 52 assert output == expected
53 53
54 54
61 .withAsset('templates/page_info.jinja', partial) 61 .withAsset('templates/page_info.jinja', partial)
62 .withPage('pages/foo', config=page_config, contents=contents)) 62 .withPage('pages/foo', config=page_config, contents=contents))
63 with mock_fs_scope(fs, open_patches=open_patches): 63 with mock_fs_scope(fs, open_patches=open_patches):
64 app = fs.getApp() 64 app = fs.getApp()
65 page = get_simple_page(app, 'foo.md') 65 page = get_simple_page(app, 'foo.md')
66 route = app.getRoute('pages', None) 66 route = app.getSourceRoute('pages', None)
67 route_metadata = {'slug': 'foo'} 67 route_metadata = {'slug': 'foo'}
68 output = render_simple_page(page, route, route_metadata) 68 output = render_simple_page(page, route, route_metadata)
69 assert output == expected 69 assert output == expected
70 70