@@ -63,9 +63,9 @@ def test_inline_attachments(self):
6363 expected = [
6464 {'Name' : 'TextFile' , 'Content' : 'content' , 'ContentType' : 'text/plain' },
6565 {
'Name' :
'InlineImage' ,
'Content' :
'image_content' ,
'ContentType' :
'image/png' ,
'ContentID' :
'cid:[email protected] ' },
66- {'Name' : 'image.png' , 'Content' : 'aW1hZ2VfZmlsZQ==\n ' , 'ContentType' : 'image/png' },
67- {
'Name' :
'image_with_id.png' ,
'Content' :
'aW5saW5lX2ltYWdlX2ZpbGU=\n ' ,
'ContentType' :
'image/png' ,
'ContentID' :
'[email protected] ' },
68- {
'Name' :
'inline_image.png' ,
'Content' :
'aW5saW5lX2ltYWdlX2ZpbGU=\n ' ,
'ContentType' :
'image/png' ,
'ContentID' :
'cid:[email protected] ' },
66+ {'Name' : 'image.png' , 'Content' : 'aW1hZ2VfZmlsZQ==' , 'ContentType' : 'image/png' },
67+ {
'Name' :
'image_with_id.png' ,
'Content' :
'aW5saW5lX2ltYWdlX2ZpbGU=' ,
'ContentType' :
'image/png' ,
'ContentID' :
'[email protected] ' },
68+ {
'Name' :
'inline_image.png' ,
'Content' :
'aW5saW5lX2ltYWdlX2ZpbGU=' ,
'ContentType' :
'image/png' ,
'ContentID' :
'cid:[email protected] ' },
6969 ]
7070 json_message = PMMail (
7171 sender = '[email protected] ' ,
to = '[email protected] ' ,
subject = 'Subject' ,
text_body = 'Body' ,
api_key = 'test' ,
@@ -78,8 +78,9 @@ def test_inline_attachments(self):
7878 ]
7979 ).to_json_message ()
8080 assert len (json_message ['Attachments' ]) == len (expected )
81- for item in expected :
82- assert item in json_message ['Attachments' ]
81+ for orig , attachment in zip (expected , json_message ['Attachments' ]):
82+ for k , v in orig .items ():
83+ assert orig [k ] == attachment [k ].rstrip ()
8384
8485
8586class PMBatchMailTests (unittest .TestCase ):
0 commit comments