def testTextRemoveTags(self): texts = [ "There is nothing to remove", "1 < 2, right?", "Conference is <b>today</b>", "Content is <no-valid-tag>valid</no-valid-tag>", "5>3<a>Multiple</a><b>tags</b>but<c></c>1<2<d>" ] results = [ "There is nothing to remove", "1 < 2, right?", "Conference is today", "Content is valid", "5>3 Multiple tags but 1<2" ] for text, result in zip(texts, results): self.assertEqual(remove_tags(text), result)
def testTextRemoveTags(self): texts = ["There is nothing to remove", "1 < 2, right?", "Conference is <b>today</b>", "Content is <no-valid-tag>valid</no-valid-tag>", "5>3<a>Multiple</a><b>tags</b>but<c></c>1<2<d>" ] results = ["There is nothing to remove", "1 < 2, right?", "Conference is today", "Content is valid", "5>3 Multiple tags but 1<2" ] for text, result in zip(texts, results): self.assertEqual(remove_tags(text), result)
def _normalize_path(self, path): return secure_filename(remove_tags(path))
def _normalize_path(self, path): if not isinstance(path, unicode): path = path.decode('utf-8') return secure_filename(remove_tags(path))