diff tests/test_data_provider.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 f987b29d6fab
children 72f17534d58e
line wrap: on
line diff
--- a/tests/test_data_provider.py	Thu May 26 19:46:28 2016 -0700
+++ b/tests/test_data_provider.py	Thu May 26 19:52:47 2016 -0700
@@ -6,21 +6,21 @@
     fs = (mock_fs()
           .withConfig()
           .withPage('posts/2015-03-01_one.md',
-                    {'title': 'One', 'category': 'Foo'})
+                    {'title': 'One', 'tags': ['Foo']})
           .withPage('posts/2015-03-02_two.md',
-                    {'title': 'Two', 'category': 'Foo'})
+                    {'title': 'Two', 'tags': ['Foo']})
           .withPage('posts/2015-03-03_three.md',
-                    {'title': 'Three', 'category': 'Bar'})
-          .withPage('pages/categories.md',
+                    {'title': 'Three', 'tags': ['Bar']})
+          .withPage('pages/tags.md',
                     {'format': 'none', 'layout': 'none'},
-                    "{%for c in blog.categories%}\n"
+                    "{%for c in blog.tags%}\n"
                     "{{c.name}} ({{c.post_count}})\n"
                     "{%endfor%}\n"))
     with mock_fs_scope(fs):
         app = fs.getApp()
-        page = app.getSource('pages').getPage({'slug': 'categories'})
-        route = app.getRoute('pages', None)
-        route_metadata = {'slug': 'categories'}
+        page = app.getSource('pages').getPage({'slug': 'tags'})
+        route = app.getSourceRoute('pages', None)
+        route_metadata = {'slug': 'tags'}
         qp = QualifiedPage(page, route, route_metadata)
         ctx = PageRenderingContext(qp)
         rp = render_page(ctx)