Exemple #1
0
 def get_accounts(cls, email_address):
     canonical = canonicalize_email(email_address)
     if not canonical:
         return []
     account_id36s = cls.get_time_sorted_columns(canonical).keys()
     return Account._byID36(account_id36s, data=True, return_dict=False)
Exemple #2
0
 def canonical_email(self):
     return canonicalize_email(self.email)
Exemple #3
0
 def test_remove_plus_address(self):
     canonical = utils.canonicalize_email("*****@*****.**")
     self.assertEquals(canonical, "*****@*****.**")
Exemple #4
0
 def test_unicode_in_byte_str(self):
     # this shouldn't ever happen, but some entries in postgres appear
     # to be byte strings with non-ascii in 'em.
     canonical = utils.canonicalize_email("\xe2\x9c\[email protected]")
     self.assertEquals(canonical, "\xe2\x9c\[email protected]")
Exemple #5
0
 def test_remove_dots(self):
     canonical = utils.canonicalize_email("*****@*****.**")
     self.assertEquals(canonical, "*****@*****.**")
Exemple #6
0
 def test_multiple_ats(self):
     canonical = utils.canonicalize_email("invalid@invalid@invalid")
     self.assertEquals(canonical, "")
Exemple #7
0
 def test_localonly(self):
     canonical = utils.canonicalize_email("invalid")
     self.assertEquals(canonical, "")
Exemple #8
0
 def test_unicode(self):
     canonical = utils.canonicalize_email(u"\[email protected]")
     self.assertEquals(canonical, "\xe2\x9c\[email protected]")
Exemple #9
0
 def test_empty_string(self):
     canonical = utils.canonicalize_email("")
     self.assertEquals(canonical, "")