def test_as_urlpatterns(self, page, patterns): """ as_urlpatterns should return a urlconf with the pages for all the nodes included in the tree. """ child1 = PageNode('child1', path='asdf/qwer', template='fake.html') child2 = PageNode('child2', path='bb/qr', template='fake2.html') parent = PageNode('parent', children=[child1, child2]) root = PageRoot('root', path='badsbi', template='fake3.html', children=[parent]) patterns.return_value = 'asdf' # Mocking properties page.__get__ = lambda mock, self, cls: self.display_name eq_(root.as_urlpatterns(), 'asdf') args = patterns.call_args[0] eq_(args[0], '') ok_('child1' in args) ok_('child2' in args) ok_('root' in args) ok_('parent' not in args)
def test_as_urlpatterns(self, page, patterns): """ as_urlpatterns should return a urlconf with the pages for all the nodes included in the tree. """ child1 = PageNode("child1", path="asdf/qwer", template="fake.html") child2 = PageNode("child2", path="bb/qr", template="fake2.html") parent = PageNode("parent", children=[child1, child2]) root = PageRoot("root", path="badsbi", template="fake3.html", children=[parent]) patterns.return_value = "asdf" # Mocking properties page.__get__ = lambda mock, self, cls: self.display_name eq_(root.as_urlpatterns(), "asdf") args = patterns.call_args[0] eq_(args[0], "") ok_("child1" in args) ok_("child2" in args) ok_("root" in args) ok_("parent" not in args)
PageNode('Wordmarks', path='wordmarks', template='styleguide/identity/thunderbird-wordmarks.html'), PageNode('Color', path='color', template='styleguide/identity/thunderbird-color.html'), )), )), PageNode('Websites', path='websites', children=( PageNode('Sandstone', path='sandstone', children=( PageNode('Overview', template='styleguide/websites/sandstone-intro.html'), PageNode('Buttons', path='buttons', template='styleguide/websites/sandstone-buttons.html'), PageNode('Colors', path='colors', template='styleguide/websites/sandstone-colors.html'), PageNode('Forms', path='forms', template='styleguide/websites/sandstone-forms.html'), PageNode('Grids', path='grids', template='styleguide/websites/sandstone-grids.html'), PageNode('Tables', path='tables', template='styleguide/websites/sandstone-tables.html'), PageNode('Tabzilla', path='tabzilla', template='styleguide/websites/sandstone-tabzilla.html'), PageNode('Typefaces', path='typefaces', template='styleguide/websites/sandstone-typefaces.html'), PageNode('Examples', path='examples', template='styleguide/websites/sandstone-examples.html'), )), PageNode('Community sites', path='community/overview', template='styleguide/websites/community-overview.html'), PageNode('Domain strategy', path='domains/overview', template='styleguide/websites/domains-overview.html'), )), PageNode('Communications', path='communications', children=( PageNode('Presentations', path='presentations', template='styleguide/communications/presentations.html'), PageNode('Video', path='video', template='styleguide/communications/video.html'), PageNode('Typefaces', path='typefaces', template='styleguide/communications/typefaces.html'), PageNode('Copy tone', path='copy-tone', template='styleguide/communications/copy-tone.html'), PageNode('Copy rules', path='copy-rules', template='styleguide/communications/copy-rules.html'), PageNode('Translation', path='translation', template='styleguide/communications/translation.html'), )), )) urlpatterns = hierarchy.as_urlpatterns()
template='styleguide/websites/domains-overview.html'), )), PageNode( 'Communications', path='communications', children=( PageNode( 'Presentations', path='presentations', template='styleguide/communications/presentations.html'), PageNode('Video', path='video', template='styleguide/communications/video.html'), PageNode('Typefaces', path='typefaces', template='styleguide/communications/typefaces.html'), PageNode('Copy tone', path='copy-tone', template='styleguide/communications/copy-tone.html'), PageNode('Copy rules', path='copy-rules', template='styleguide/communications/copy-rules.html'), PageNode( 'Translation', path='translation', template='styleguide/communications/translation.html'), )), )) urlpatterns = hierarchy.as_urlpatterns()