Mercurial > piecrust2
diff tests/test_serving.py @ 515:16e705c58cae
internal: Improve handling of taxonomy term slugification.
This paves the way to bring slugification options like transliteration to
PieCrust. This change mostly makes sure we use one-way slugification, which
means, for serving/previewing, we need to slugify each page's terms to compare
to the stuff captured from the URL. It also simplifies things a bit in the
code.
author | Ludovic Chabant <ludovic@chabant.com> |
---|---|
date | Sun, 26 Jul 2015 23:16:15 -0700 |
parents | b45322924d18 |
children | 64e696adb99e |
line wrap: on
line diff
--- a/tests/test_serving.py Sun Jul 26 23:05:04 2015 -0700 +++ b/tests/test_serving.py Sun Jul 26 23:16:15 2015 -0700 @@ -77,11 +77,10 @@ page = app.getSource('pages').getPage({'slug': '_tag', 'tag': tag}) route = app.getTaxonomyRoute('tags', 'posts') route_metadata = {'slug': '_tag', 'tag': tag} - taxonomy = app.getTaxonomy('tags') qp = QualifiedPage(page, route, route_metadata) ctx = PageRenderingContext(qp) - ctx.setTaxonomyFilter(taxonomy, tag) + ctx.setTaxonomyFilter(tag) rp = render_page(ctx) expected = "Pages in %s\n" % tag @@ -122,11 +121,10 @@ 'category': category}) route = app.getTaxonomyRoute('categories', 'posts') route_metadata = {'slug': '_category', 'category': category} - taxonomy = app.getTaxonomy('categories') qp = QualifiedPage(page, route, route_metadata) ctx = PageRenderingContext(qp) - ctx.setTaxonomyFilter(taxonomy, category) + ctx.setTaxonomyFilter(category) rp = render_page(ctx) expected = "Pages in %s\n" % category