Skip to content

Scrapy, a fast high-level web crawling & scraping framework for Python.

py3: fix test_mail - get_payload returns bytes when decode is True

Konstantin Lopuhin9704226ee4c9
diff --git a/tests/test_mail.py b/tests/test_mail.py
index 58d44bdb3..25dd35099 100644
--- a/tests/test_mail.py
+++ b/tests/test_mail.py
@@ -53,8 +53,8 @@ class MailSenderTest(unittest.TestCase):
self.assertEqual(len(payload), 2)
text, attach = payload
- self.assertEqual(text.get_payload(decode=True), 'body')
- self.assertEqual(attach.get_payload(decode=True), 'content')
+ self.assertEqual(text.get_payload(decode=True), b'body')
+ self.assertEqual(attach.get_payload(decode=True), b'content')
def _catch_mail_sent(self, **kwargs):
self.catched_msg = dict(**kwargs)