def test_email_parts(self): name, email = appier.email_parts("João Magalhães <*****@*****.**>") self.assertEqual(type(name), str) self.assertEqual(type(email), str) self.assertEqual(name, "João Magalhães") self.assertEqual(email, "*****@*****.**") name, email = appier.email_parts( appier.legacy.u("João Magalhães <*****@*****.**>")) self.assertEqual(type(name), appier.legacy.UNICODE) self.assertEqual(type(email), appier.legacy.UNICODE) self.assertEqual(name, appier.legacy.u("João Magalhães")) self.assertEqual(email, appier.legacy.u("*****@*****.**")) name, email = appier.email_parts( appier.legacy.u("你好世界 <*****@*****.**>")) self.assertEqual(type(name), appier.legacy.UNICODE) self.assertEqual(type(email), appier.legacy.UNICODE) self.assertEqual(name, appier.legacy.u("你好世界")) self.assertEqual(email, appier.legacy.u("*****@*****.**")) name, email = appier.email_parts(appier.legacy.u(" [email protected] ")) self.assertEqual(type(name), appier.legacy.UNICODE) self.assertEqual(type(email), appier.legacy.UNICODE) self.assertEqual(name, appier.legacy.u("*****@*****.**")) self.assertEqual(email, appier.legacy.u("*****@*****.**"))
def test_email_parts(self): name, email = appier.email_parts("João Magalhães <*****@*****.**>") self.assertEqual(type(name), str) self.assertEqual(type(email), str) self.assertEqual(name, "João Magalhães") self.assertEqual(email, "*****@*****.**") name, email = appier.email_parts(appier.legacy.u("João Magalhães <*****@*****.**>")) self.assertEqual(type(name), appier.legacy.UNICODE) self.assertEqual(type(email), appier.legacy.UNICODE) self.assertEqual(name, appier.legacy.u("João Magalhães")) self.assertEqual(email, appier.legacy.u("*****@*****.**")) name, email = appier.email_parts(appier.legacy.u("你好世界 <*****@*****.**>")) self.assertEqual(type(name), appier.legacy.UNICODE) self.assertEqual(type(email), appier.legacy.UNICODE) self.assertEqual(name, appier.legacy.u("你好世界")) self.assertEqual(email, appier.legacy.u("*****@*****.**"))