Пример #1
0
 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)
Пример #2
0
 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)
Пример #3
0
 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)
Пример #4
0
 def test_unknown_html(self):
     self.assertDictEqual(module.get_nodes_for_template(self.node, '/paper3.html'), {'/paper3.html': self.node.root})
Пример #5
0
 def test_paper1_html(self):
     self.assertEqual(module.get_nodes_for_template(self.node, '/folder1.html').values()[0], self.node.root.folder1)
Пример #6
0
 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')
Пример #7
0
 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)
Пример #8
0
 def test_no_leading_slash(self):
     self.assertEqual(module.get_nodes_for_template(self.node, 'folder1/index.html').values()[0], self.node.root.folder1)