PageRenderTime 33ms CodeModel.GetById 27ms app.highlight 3ms RepoModel.GetById 1ms app.codeStats 0ms

/tests/testapp/navigation_extensions.py

http://github.com/feincms/feincms
Python | 19 lines | 11 code | 7 blank | 1 comment | 2 complexity | e0185b71c1e2e9bc78832fd5a2c9b985 MD5 | raw file
 1from __future__ import absolute_import, unicode_literals
 2
 3from feincms.module.page.extensions.navigation import NavigationExtension, PagePretender
 4
 5
 6class PassthroughExtension(NavigationExtension):
 7    # See PagesTestCase.test_23_navigation_extension
 8    name = "passthrough extension"
 9
10    def children(self, page, **kwargs):
11        for p in page.children.in_navigation():
12            yield p
13
14
15class PretenderExtension(NavigationExtension):
16    name = "pretender extension"
17
18    def children(self, page, **kwargs):
19        return [PagePretender(title="blabla", url="/asdsa/")]