1
0
mirror of https://github.com/django/django.git synced 2025-10-31 09:41:08 +00:00

Refs #34118 -- Improved sanitize_address() error message for tuple with empty strings.

This commit is contained in:
Mariusz Felisiak
2023-07-17 11:03:36 +02:00
committed by GitHub
parent 0016a42995
commit da2f8e8257
2 changed files with 4 additions and 1 deletions

View File

@@ -1084,9 +1084,10 @@ class MailTests(HeadersCheckMixin, SimpleTestCase):
"@",
"to@",
"@example.com",
("", ""),
):
with self.subTest(email_address=email_address):
with self.assertRaises(ValueError):
with self.assertRaisesMessage(ValueError, "Invalid address"):
sanitize_address(email_address, encoding="utf-8")
def test_sanitize_address_header_injection(self):