From da2f8e8257d1bea4215381684ca4abfcee333c43 Mon Sep 17 00:00:00 2001 From: Mariusz Felisiak Date: Mon, 17 Jul 2023 11:03:36 +0200 Subject: Refs #34118 -- Improved sanitize_address() error message for tuple with empty strings. --- tests/mail/tests.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'tests') diff --git a/tests/mail/tests.py b/tests/mail/tests.py index 54a136c1a9..848ee32e9f 100644 --- a/tests/mail/tests.py +++ b/tests/mail/tests.py @@ -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): -- cgit v1.3