@@ -85,9 +85,9 @@ def test_email_message(self):
8585 self .
assertEqual (
data [
'To' ],
'[email protected] , Also To <[email protected] >' )
8686 self .
assertEqual (
data [
'Bcc' ],
'[email protected] , Also BCC <[email protected] >' )
8787 self .
assertEqual (
data [
'Cc' ],
'[email protected] , Also CC <[email protected] >' )
88+ self .
assertEqual (
data [
'ReplyTo' ],
'[email protected] ' )
8889 self .assertCountEqual (data ['Headers' ], [
8990 {
'Name' :
'Message-ID' ,
'Value' :
'[email protected] ' },
90- {
'Name' :
'Reply-To' ,
'Value' :
'[email protected] ' },
9191 {'Name' : 'X-MyHeader' , 'Value' : 'my value' },
9292 ])
9393
@@ -136,6 +136,16 @@ def test_reply_to(self):
136136 self .
assertEqual (
data [
'ReplyTo' ],
'[email protected] , Other <[email protected] >' )
137137 self .assertEqual (data ['Headers' ], [{'Name' : 'X-Other' , 'Value' : 'Keep' }]) # don't lose other headers
138138
139+ def test_reply_to_header (self ):
140+ # Reply-To needs to be moved out of headers, into dedicated param
141+ email = mail .
EmailMessage (
'Subject' ,
'Body goes here' ,
'[email protected] ' , [
'[email protected] ' ],
142+ headers = {
'reply-to' :
'[email protected] , Other <[email protected] >' ,
143+ 'X-Other' : 'Keep' })
144+ email .send ()
145+ data = self .get_api_call_json ()
146+ self .
assertEqual (
data [
'ReplyTo' ],
'[email protected] , Other <[email protected] >' )
147+ self .assertEqual (data ['Headers' ], [{'Name' : 'X-Other' , 'Value' : 'Keep' }]) # don't lose other headers
148+
139149 def test_attachments (self ):
140150 text_content = "* Item one\n * Item two\n * Item three"
141151 self .message .attach (filename = "test.txt" , content = text_content , mimetype = "text/plain" )
0 commit comments