import unittest import cleanhtml trial = """ junct Account
New Recent Upload Search Calendar Progress Admin Groups Me Home

My Account

Home Topic
Size of the editing window Rows: Columns:
Number of days to show in Recent Topics
Allow Invitations from groups
My email addresses Add an address
Notify
fumanchu@aminus.org Drop
""" class CleanTests(unittest.TestCase): def test_Plaintext(self): trial = """Puerto Peñasco""" final = u"""Puerto Pe\xf1asco""" self.assertEqual(cleanhtml.plaintext(trial), final) def test_StripTags(self): final = """ junct Account self.name = 'page2004-02-29T00:04:04.327000_7ffffff5'; New Recent Upload Search Calendar Progress Admin Groups Me Home My Account Home Topic Size of the editing window Rows: Columns: Number of days to show in Recent Topics Allow Invitations from groups My email addresses Add an address Notify fumanchu@aminus.org Drop """ self.assertEqual(cleanhtml.striptags(trial), final) def test_Sanitize(self): final = """ junct Account self.name = 'page2004-02-29T00:04:04.327000_7ffffff5';
New Recent Upload Search Calendar Progress Admin Groups Me Home

My Account

Home Topic
Size of the editing window Rows: Columns:
Number of days to show in Recent Topics
Allow Invitations from groups
My email addresses Add an address
Notify
fumanchu@aminus.org Drop
""" self.assertEqual(cleanhtml.sanitize(trial), final) if __name__ == "__main__": unittest.main()