예제 #1
0
    def test_two_children(self):
        self.my_setup([MagicMock(pk='child1'), MagicMock(pk='child2')])

        result = create_choices(self.root, [], is_last_child=True)
        self.assertEqual(len(result), 3)
예제 #2
0
 def test_two_children_prefix_second(self):
     self.my_setup([MagicMock(pk='child1'), MagicMock(pk='child2')])
     result = create_choices(self.root, [], is_last_child=True)
     self.assertTrue(result[2][1].startswith(TreePadTest.CORNER))
예제 #3
0
 def test_root_node(self):
     self.my_setup()
     result = create_choices(self.root, [], is_last_child=True)
     self.assertEqual(result, [('root', u'root')])