def test_05_utils_find_selected(self): tree_nodes, flat_nodes = self._get_nodes() node = flat_nodes[0] selected = find_selected(tree_nodes) self.assertEqual(selected, node) selected = find_selected([]) self.assertEqual(selected, None)
def test_utils_find_selected(self): tree_nodes, flat_nodes = self._get_nodes() node = flat_nodes[0] selected = find_selected(tree_nodes) self.assertEqual(selected, node) selected = find_selected([]) self.assertEqual(selected, None)
def test_24_utils_find_selected(self): with SettingsOverride(CMS_MODERATOR=False): tree_nodes, flat_nodes = self._get_nodes() node = flat_nodes[0] selected = find_selected(tree_nodes) self.assertEqual(selected, node) selected = find_selected([]) self.assertEqual(selected, None)
def test_find_selected(self): subchild = AttributeObject() firstchild = AttributeObject(ancestor=True, children=[subchild]) selectedchild = AttributeObject(selected=True) secondchild = AttributeObject(ancestor=True, children=[selectedchild]) root = AttributeObject(ancestor=True, children=[firstchild, secondchild]) nodes = [root] selected = find_selected(nodes) self.assertEqual(selected, selectedchild)