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)
def canonical_email(self): return canonicalize_email(self.email)
def test_remove_plus_address(self): canonical = utils.canonicalize_email("*****@*****.**") self.assertEquals(canonical, "*****@*****.**")
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]")
def test_remove_dots(self): canonical = utils.canonicalize_email("*****@*****.**") self.assertEquals(canonical, "*****@*****.**")
def test_multiple_ats(self): canonical = utils.canonicalize_email("invalid@invalid@invalid") self.assertEquals(canonical, "")
def test_localonly(self): canonical = utils.canonicalize_email("invalid") self.assertEquals(canonical, "")
def test_unicode(self): canonical = utils.canonicalize_email(u"\[email protected]") self.assertEquals(canonical, "\xe2\x9c\[email protected]")
def test_empty_string(self): canonical = utils.canonicalize_email("") self.assertEquals(canonical, "")