Mercurial > piecrust2
diff tests/test_data_assetor.py @ 33:62c7a97c8340
Get the un-paginated URL of a page early and pass that around.
author | Ludovic Chabant <ludovic@chabant.com> |
---|---|
date | Tue, 19 Aug 2014 15:36:28 -0700 |
parents | 43091c9837bf |
children | 485682a6de50 |
line wrap: on
line diff
--- a/tests/test_data_assetor.py Tue Aug 19 14:30:19 2014 -0700 +++ b/tests/test_data_assetor.py Tue Aug 19 15:36:28 2014 -0700 @@ -58,19 +58,16 @@ @pytest.mark.parametrize('url_format, pretty_urls, uri, expected', [ ('%uri%', True, '/foo', '/foo/'), - ('%uri%', True, '/foo/2', '/foo/'), ('%uri%', True, '/foo.ext', '/foo.ext/'), - ('%uri%', True, '/foo.ext/2', '/foo.ext/'), ('%uri%', False, '/foo.html', '/foo/'), - ('%uri%', False, '/foo/2.html', '/foo/'), + ('%uri%', False, '/foo.ext', '/foo/'), ]) def test_build_base_url(url_format, pretty_urls, uri, expected): app = MagicMock() app.env = MagicMock() app.env.base_asset_url_format = url_format app.config = { - 'site/pretty_urls': pretty_urls, - '__cache/pagination_suffix_re': '/(?P<num>\\d+)$'} + 'site/pretty_urls': pretty_urls} assets_path = 'foo/bar-assets' actual = build_base_url(app, uri, assets_path) assert actual == expected