(self)
| 453 | EmailMessage(**params) |
| 454 | |
| 455 | def test_header_injection(self): |
| 456 | msg = "Header values may not contain linefeed or carriage return characters" |
| 457 | cases = [ |
| 458 | {"subject": "Subject\nInjection Test"}, |
| 459 | {"subject": gettext_lazy("Lazy Subject\nInjection Test")}, |
| 460 | {"to": ["Name\nInjection test <to@example.com>"]}, |
| 461 | ] |
| 462 | for kwargs in cases: |
| 463 | with self.subTest(case=kwargs): |
| 464 | email = EmailMessage(**kwargs) |
| 465 | with self.assertRaisesMessage(ValueError, msg): |
| 466 | email.message() |
| 467 | |
| 468 | def test_folding_white_space(self): |
| 469 | """ |
nothing calls this directly
no test coverage detected