def test_items_hook_tree(self): def my_processor(tree_items, tree_sender): for item in tree_items: item.title_resolved = 'FakedTreeItem' return tree_items register_items_hook(my_processor) items = self.sitetree.tree('tree1', get_mock_context(path='/')) register_items_hook(None) self.assertEqual(items[0].title_resolved, 'FakedTreeItem')
def test_items_hook_breadcrumbs(self): def my_processor(tree_items, tree_sender): for item in tree_items: item.title_resolved = 'FakedBreadcrumbsItem' return tree_items register_items_hook(my_processor) items = self.sitetree.breadcrumbs( 'tree1', get_mock_context(path='/not_articles/10/')) register_items_hook(None) self.assertEqual(items[0].title_resolved, 'FakedBreadcrumbsItem')
def test_items_hook_breadcrumbs(self): def my_processor(tree_items, tree_sender): for item in tree_items: item.title_resolved = 'FakedBreadcrumbsItem' return tree_items register_items_hook(my_processor) items = self.sitetree.breadcrumbs('tree1', get_mock_context(path='/not_articles/10/')) register_items_hook(None) self.assertEqual(items[0].title_resolved, 'FakedBreadcrumbsItem')
def test_items_hook_menu(self): def my_processor(tree_items, tree_sender): for item in tree_items: item.title_resolved = 'FakedMenuItem' return tree_items register_items_hook(my_processor) items = self.sitetree.menu('tree1', 'trunk', get_mock_context(path='/')) register_items_hook(None) self.assertEqual(items[0].title_resolved, 'FakedMenuItem')