|
68 | 68 | ascii_email='jeff@xn--fiqq24b10vi0d.tw',
|
69 | 69 | ),
|
70 | 70 | ),
|
| 71 | + ( |
| 72 | + '"quoted local part"@example.org', |
| 73 | + ValidatedEmail( |
| 74 | + local_part='"quoted local part"', |
| 75 | + ascii_local_part='"quoted local part"', |
| 76 | + smtputf8=False, |
| 77 | + ascii_domain='example.org', |
| 78 | + domain='example.org', |
| 79 | + normalized='"quoted local part"@example.org', |
| 80 | + ascii_email='"quoted local part"@example.org' |
| 81 | + ), |
| 82 | + ), |
| 83 | + ( |
| 84 | + '"de-quoted.local.part"@example.org', |
| 85 | + ValidatedEmail( |
| 86 | + local_part='de-quoted.local.part', |
| 87 | + ascii_local_part='de-quoted.local.part', |
| 88 | + smtputf8=False, |
| 89 | + ascii_domain='example.org', |
| 90 | + domain='example.org', |
| 91 | + normalized='de-quoted.local.part@example.org', |
| 92 | + ascii_email='de-quoted.local.part@example.org' |
| 93 | + ), |
| 94 | + ), |
71 | 95 | ],
|
72 | 96 | )
|
73 | 97 | def test_email_valid(email_input, output):
|
74 | 98 | # These addresses do not require SMTPUTF8. See test_email_valid_intl_local_part
|
75 | 99 | # for addresses that are valid but require SMTPUTF8. Check that it passes with
|
76 | 100 | # allow_smtput8 both on and off.
|
77 |
| - emailinfo = validate_email(email_input, check_deliverability=False, allow_smtputf8=False) |
| 101 | + emailinfo = validate_email(email_input, check_deliverability=False, allow_smtputf8=False, |
| 102 | + allow_quoted_local=True) |
78 | 103 | assert emailinfo == output
|
79 |
| - assert validate_email(email_input, check_deliverability=False, allow_smtputf8=True) == output |
| 104 | + assert validate_email(email_input, check_deliverability=False, allow_smtputf8=True, |
| 105 | + allow_quoted_local=True) == output |
80 | 106 |
|
81 | 107 | # Check that the old `email` attribute to access the normalized form still works
|
82 | 108 | # if the DeprecationWarning is suppressed.
|
|
0 commit comments