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)
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))
def test_root_node(self): self.my_setup() result = create_choices(self.root, [], is_last_child=True) self.assertEqual(result, [('root', u'root')])