def is_preapproved_tag_name(tag_name): """true if tag name is in the category tree or any other container of preapproved tags""" #get list of preapproved tags, to make exceptions for if askbot_settings.TAG_SOURCE == 'category-tree': return tag_name in category_tree.get_leaf_names() return False
def is_preapproved_tag_name(tag_name): """true if tag name is in the category tree or any other container of preapproved tags""" # get list of preapproved tags, to make exceptions for if askbot_settings.TAG_SOURCE == 'category-tree': return tag_name in category_tree.get_leaf_names() return False
def test_get_leaf_names(self): leaf_names = ct.get_leaf_names(self.tree) self.assertEqual( leaf_names, set([ 'cars', 'volkswagen', 'zhiguli', 'cats', 'meow', 'tigers', 'rrrr', 'music', 'play', 'listen', 'loud', 'buy', 'download' ]))
def test_get_leaf_names(self): leaf_names = ct.get_leaf_names(self.tree) self.assertEqual( leaf_names, set([ 'cars', 'volkswagen', 'zhiguli', 'cats', 'meow', 'tigers', 'rrrr', 'music', 'play', 'listen', 'loud', 'buy', 'download' ]) )
def test_get_leaf_names_empty(self): self.assertEqual( set([]), ct.get_leaf_names(None) )
def test_get_leaf_names_empty(self): self.assertEqual(set([]), ct.get_leaf_names(None))