(s: str, expected_error: str)
| 516 | ], |
| 517 | ) |
| 518 | def test_email_unsafe_character(s: str, expected_error: str) -> None: |
| 519 | # Check for various unsafe characters that are permitted by the email |
| 520 | # specs but should be disallowed for being unsafe or not sensible Unicode. |
| 521 | |
| 522 | with pytest.raises(EmailSyntaxError) as exc_info: |
| 523 | validate_email(s + "@test", test_environment=True) |
| 524 | assert str(exc_info.value) == f"The email address contains unsafe characters: {expected_error}." |
| 525 | |
| 526 | with pytest.raises(EmailSyntaxError) as exc_info: |
| 527 | validate_email("test@" + s, test_environment=True) |
| 528 | assert "The email address contains unsafe characters" in str(exc_info.value) |
| 529 | |
| 530 | |
| 531 | @pytest.mark.parametrize( |
nothing calls this directly
no test coverage detected