IDNA encoding is applied to non-ASCII domains in address headers (#14301). See also test_address_header_handling() for several variations in the to field.
(self)
| 1453 | email.message() |
| 1454 | |
| 1455 | def test_idn_addresses(self): |
| 1456 | """ |
| 1457 | IDNA encoding is applied to non-ASCII domains in address headers |
| 1458 | (#14301). |
| 1459 | |
| 1460 | See also test_address_header_handling() for several variations in the |
| 1461 | to field. |
| 1462 | """ |
| 1463 | email = EmailMessage( |
| 1464 | from_email="from@öäü.com", to=["to@öäü.com"], cc=["cc@öäü.com"] |
| 1465 | ) |
| 1466 | email.send() |
| 1467 | message = self.get_outbox_message() |
| 1468 | self.assertEqual(message.get("from"), "from@xn--4ca9at.com") |
| 1469 | self.assertEqual(message.get("to"), "to@xn--4ca9at.com") |
| 1470 | self.assertEqual(message.get("cc"), "cc@xn--4ca9at.com") |
| 1471 | |
| 1472 | def test_localpart_only_address(self): |
| 1473 | """ |
nothing calls this directly
no test coverage detected