Fixing python3
This commit is contained in:
Awais Qureshi
2019-09-20 15:41:45 +05:00
parent c6edb954d5
commit 8c1957fd5e
2 changed files with 2 additions and 2 deletions

View File

@@ -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

View File

@@ -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