Ejemplo n.º 1
0
 def test_invalid_newline_after_local_part(self):
     with self.assertRaises(
         ValueError,
         msg="The email address contains invalid characters before the "
         "@-sign: \n.",
     ):
         validate_email_address(u"my\[email protected]")
Ejemplo n.º 2
0
 def test_invalid_leading_dots(self):
     with self.assertRaises(
         ValueError,
         msg="An email address cannot have a period immediately after the "
         "@-sign.",
     ):
         validate_email_address(u"*****@*****.**")
Ejemplo n.º 3
0
 def test_invalid_consecutive_dots_in_local_part(self):
     with self.assertRaises(
         ValueError,
         msg="The email address contains invalid characters before the "
         "@-sign: ..",
     ):
         validate_email_address(u"*****@*****.**")
Ejemplo n.º 4
0
 def test_invalid_newline_in_domain(self):
     with self.assertRaises(
         ValueError,
         msg="The domain name example\n.com contains invalid characters "
         "(Codepoint U+000A at position 8 of 'example\\n' not allowed).",
     ):
         validate_email_address(u"my@example\n.com")
Ejemplo n.º 5
0
 def test_invalid_two_leading_dots_in_local_part(self):
     with self.assertRaises(
         ValueError,
         msg="The email address contains invalid characters before the "
         "@-sign: ..",
     ):
         validate_email_address(u"*****@*****.**")
Ejemplo n.º 6
0
 def test_invalid_trailing_dash_component(self):
     with self.assertRaises(
         ValueError,
         msg="The domain name baddash.b-.com contains invalid characters "
         "(Label must not start or end with a hyphen).",
     ):
         validate_email_address(u"*****@*****.**")
Ejemplo n.º 7
0
 def test_invalid_invalid_character_in_domain(self):
     with self.assertRaises(
         ValueError,
         msg="The domain name ⒈wouldbeinvalid.com contains invalid "
         "characters (Codepoint U+2488 not allowed "
         "at position 1 in '⒈wouldbeinvalid.com').",
     ):
         validate_email_address(u"me@⒈wouldbeinvalid.com")
Ejemplo n.º 8
0
 def test_invalid_local_part_too_long(self):
     with self.assertRaises(
         ValueError,
         msg="The email address is too long before the @-sign "
         "(2 characters too many).",
     ):
         validate_email_address(
             u"111111111122222222223333333333"
             u"444444444455555555556666666666777777"
             u"@example.com"
         )
Ejemplo n.º 9
0
 def test_invalid_domain_too_long(self):
     with self.assertRaises(
         ValueError, msg="The email address is too long after the @-sign."
     ):
         validate_email_address(
             u"me"
             u"@1111111111222222222233333333334444444444555555555"
             u".6666666666777777777788888888889999999999000000000"
             u".1111111111222222222233333333334444444444555555555"
             u".6666666666777777777788888888889999999999000000000"
             u".111111111122222222223333333333444444444455555555556"
             u".com"
         )
Ejemplo n.º 10
0
 def test_invalid_too_long_after_local_part_conversion(self):
     with self.assertRaises(
         ValueError,
         msg="The email address is too long (when encoded in bytes).",
     ):
         validate_email_address(
             u"my.λong.address"
             u"@1111111111222222222233333333334444444444555555555"
             u".6666666666777777777788888888889999999999000000000"
             u".1111111111222222222233333333334444444444555555555"
             u".6666666666777777777788888888889999999999000000000"
             u".111111111122222222223333333333444"
             u".info"
         )
Ejemplo n.º 11
0
 def test_invalid_too_long(self):
     with self.assertRaises(
         ValueError,
         msg="The email address is too long (2 characters too many).",
     ):
         validate_email_address(
             u"my.long.address"
             u"@1111111111222222222233333333334444444444555555555"
             u".6666666666777777777788888888889999999999000000000"
             u".1111111111222222222233333333334444444444555555555"
             u".6666666666777777777788888888889999999999000000000"
             u".11111111112222222222333333333344444"
             u".info"
         )
Ejemplo n.º 12
0
 def test_invalid_too_long_after_domain_conversion(self):
     with self.assertRaises(
         ValueError,
         msg="The email address is too long "
         "(when converted to IDNA ASCII).",
     ):
         validate_email_address(
             u"my.long.address"
             u"@λ111111111222222222233333333334444444444555555555"
             u".6666666666777777777788888888889999999999000000000"
             u".1111111111222222222233333333334444444444555555555"
             u".6666666666777777777788888888889999999999000000000"
             u".11111111112222222222333333"
             u".info"
         )
Ejemplo n.º 13
0
 def test_invalid_too_long_before_local_part_conversion(self):
     with self.assertRaises(
         ValueError,
         msg="The email address is too long "
         "(at least 1 character too many).",
     ):
         validate_email_address(
             u"my.λong.address"
             u"@1111111111222222222233333333334444444444555555555"
             u".6666666666777777777788888888889999999999000000000"
             u".1111111111222222222233333333334444444444555555555"
             u".6666666666777777777788888888889999999999000000000"
             u".1111111111222222222233333333334444"
             u".info"
         )
Ejemplo n.º 14
0
 def test_valid_devangari_local_part_long(self):
     validate_email_address(u"उदाहरण.परीक्ष@domain.with.idn.tld")
Ejemplo n.º 15
0
 def test_valid_cyrilic_long(self):
     validate_email_address(u"чебурашкаящик-с-апельсинами.рф@example.com")
Ejemplo n.º 16
0
 def test_valid_chinese_local_part_long(self):
     validate_email_address(u"甲斐黒川日本@example.com")
Ejemplo n.º 17
0
 def test_valid_chinese_local_part(self):
     validate_email_address(u"我買@example.com")
Ejemplo n.º 18
0
 def test_valid_accents(self):
     validate_email_address(u"ñoñó@example.com")
Ejemplo n.º 19
0
 def test_invalid_mixed_local_part_not_normalized(self):
     with self.assertRaises(
         ValueError, msg="email address is not normalized"
     ):
         validate_email_address(u"jeff葉@臺網中心.tw")
Ejemplo n.º 20
0
 def test_invalid_all_taiwanese_not_normalized(self):
     with self.assertRaises(
         ValueError, msg="email address is not normalized"
     ):
         validate_email_address(u"葉士豪@臺網中心.台灣")
Ejemplo n.º 21
0
 def test_valid_mixed_ascii_taiwanese(self):
     validate_email_address(u"jeff@臺網中心.tw")
Ejemplo n.º 22
0
 def test_valid_mad_symbols_in_local_part(self):
     validate_email_address(u"!#$%&'*+-/=?^_`.{|}[email protected]")
Ejemplo n.º 23
0
 def test_invalid_missing_local_part(self):
     with self.assertRaises(
         ValueError, msg="There must be something before the @-sign."
     ):
         validate_email_address(u"@example.com")
Ejemplo n.º 24
0
 def test_valid_chinese(self):
     validate_email_address(u"伊昭傑@郵件.商務")
Ejemplo n.º 25
0
 def test_valid_greek_mixed(self):
     validate_email_address(u"ιωάννης@εεττ.gr")
Ejemplo n.º 26
0
 def test_valid_devanagari(self):
     validate_email_address(u"राम@मोहन.ईन्फो")
Ejemplo n.º 27
0
 def test_valid_simple(self):
     validate_email_address(u"*****@*****.**")
Ejemplo n.º 28
0
 def test_valid_cyrilic(self):
     validate_email_address(u"юзер@екзампл.ком")
Ejemplo n.º 29
0
 def test_invalid_consecutive_dots(self):
     with self.assertRaises(
         ValueError,
         msg="An email address cannot have two periods in a row.",
     ):
         validate_email_address(u"*****@*****.**")
Ejemplo n.º 30
0
 def test_valid_greek(self):
     validate_email_address(u"θσερ@εχαμπλε.ψομ")