From aba0e541caaa086f183197eaaca0ac20a730bbe4 Mon Sep 17 00:00:00 2001 From: Jake Howard Date: Sun, 9 Jun 2024 09:09:07 +0100 Subject: Fixed #35537 -- Changed EmailMessage.attachments and EmailMultiAlternatives.alternatives to use namedtuples. This makes it more descriptive to pull out the named fields. --- tests/logging_tests/tests.py | 2 +- tests/mail/tests.py | 32 ++++++++++++++++++++++++++++++-- tests/view_tests/tests/test_debug.py | 4 ++-- 3 files changed, 33 insertions(+), 5 deletions(-) (limited to 'tests') diff --git a/tests/logging_tests/tests.py b/tests/logging_tests/tests.py index 610bdc1124..e58109fb78 100644 --- a/tests/logging_tests/tests.py +++ b/tests/logging_tests/tests.py @@ -467,7 +467,7 @@ class AdminEmailHandlerTest(SimpleTestCase): msg = mail.outbox[0] self.assertEqual(msg.subject, "[Django] ERROR: message") self.assertEqual(len(msg.alternatives), 1) - body_html = str(msg.alternatives[0][0]) + body_html = str(msg.alternatives[0].content) self.assertIn('
', body_html) self.assertNotIn("