File tree Expand file tree Collapse file tree 2 files changed +0
-13
lines changed Expand file tree Collapse file tree 2 files changed +0
-13
lines changed Original file line number Diff line number Diff line change 1
- import os
2
-
3
1
from django .core .mail import EmailMultiAlternatives
4
2
from django .core .mail .message import EmailMessage
5
3
@@ -64,27 +62,17 @@ def test_attachment():
64
62
email_message = EmailMessage (** base_options )
65
63
email_message .attach ('file.txt' , 'test content' , 'text/plain' )
66
64
67
- current_dir = os .path .dirname (os .path .abspath (__file__ ))
68
- test_file = os .path .join (current_dir , 'testfile.txt' )
69
- email_message .attach_file (test_file )
70
-
71
65
actual = SparkPostMessage (email_message )
72
66
expected = dict (
73
67
attachments = [
74
68
{
75
69
'name' : 'file.txt' ,
76
70
'data' : 'test content' ,
77
71
'type' : 'text/plain'
78
- },
79
- {
80
- 'name' : 'testfile.txt' ,
81
- 'data' : 'hello there!\n ' ,
82
- 'type' : 'text/plain'
83
72
}
84
73
]
85
74
)
86
75
expected .update (base_expected )
87
-
88
76
assert actual == expected
89
77
90
78
if at_least_version ('1.8' ):
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments