From 8c1957fd5e40d78d4b103de01309345b1965d229 Mon Sep 17 00:00:00 2001 From: Awais Qureshi Date: Fri, 20 Sep 2019 15:41:45 +0500 Subject: [PATCH] BOM-641 Fixing python3 --- openedx/core/djangoapps/credit/email_utils.py | 2 +- openedx/core/djangoapps/credit/tests/test_api.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/openedx/core/djangoapps/credit/email_utils.py b/openedx/core/djangoapps/credit/email_utils.py index 36450a594c..1313b840e2 100644 --- a/openedx/core/djangoapps/credit/email_utils.py +++ b/openedx/core/djangoapps/credit/email_utils.py @@ -171,7 +171,7 @@ def attach_image(img_dict, filename): if img_path: with open(img_path, 'rb') as img: msg_image = MIMEImage(img.read(), name=os.path.basename(img_path)) - msg_image.add_header('Content-ID', b'<{}>'.format(img_dict['cid'])) # xss-lint: disable=python-wrap-html + msg_image.add_header('Content-ID', '<{}>'.format(img_dict['cid'])) # xss-lint: disable=python-wrap-html msg_image.add_header("Content-Disposition", "inline", filename=filename) return msg_image diff --git a/openedx/core/djangoapps/credit/tests/test_api.py b/openedx/core/djangoapps/credit/tests/test_api.py index 4a3e5adc02..421ef7724e 100644 --- a/openedx/core/djangoapps/credit/tests/test_api.py +++ b/openedx/core/djangoapps/credit/tests/test_api.py @@ -702,7 +702,7 @@ class CreditRequirementApiTests(CreditApiTestBase): # strip enclosing angle brackets from 'logo_image' cache 'Content-ID' image_id = email_image.get('Content-ID', '')[1:-1] self.assertIsNotNone(image_id) - self.assertIn(image_id, html_content_first.decode('utf-8')) + self.assertIn(image_id, html_content_first) self.assertIn( 'credit from Hogwarts School of Witchcraft and Wizardry for', html_content_first