def test_grand_children(self): nodes = {'/folder2/document.html': self.node.get_by_url('/folder2/document'), '/folder1/document.html': self.node.get_by_url('/folder1/document'), '/document/title.html': self.node.get_by_url('/document/title'), '/document/content.html': self.node.get_by_url('/document/content'), } self.assertDictEqual(module.get_nodes_for_template(self.node, '/_children/_children.html'), nodes)
def test_children_html(self): nodes = {'/folder1/document.html': self.node.get_by_url('/folder1/document')} self.assertDictEqual(module.get_nodes_for_template(self.node, '/folder1/_children.html'), nodes)
def test_children(self): nodes = {'/folder2/index.html': self.node.get_by_url('/folder2'), '/folder1/index.html': self.node.get_by_url('/folder1'), '/document/index.html': self.node.get_by_url('/document'), } self.assertDictEqual(module.get_nodes_for_template(self.node, '/_children/index.html'), nodes)
def test_unknown_html(self): self.assertDictEqual(module.get_nodes_for_template(self.node, '/paper3.html'), {'/paper3.html': self.node.root})
def test_paper1_html(self): self.assertEqual(module.get_nodes_for_template(self.node, '/folder1.html').values()[0], self.node.root.folder1)
def test_reverse_url(self): self.assertEqual(module.get_nodes_for_template(self.node, '/folder1/document/index.html').values()[0].get_absolute_url(), '/folder1/document')
def test_two_deep(self): self.assertEqual(module.get_nodes_for_template(self.node, '/folder1/document/index.html').values()[0], self.node.root.folder1.document)
def test_no_leading_slash(self): self.assertEqual(module.get_nodes_for_template(self.node, 'folder1/index.html').values()[0], self.node.root.folder1)