'Make sure headers can be set with a different encoding than utf-8 in
SafeMIMEMultipart as well'

def test_safe_mime_multipart(self):

    headers = {'Date': 'Fri,    09    Nov    2001    01:08:47    -0000', 'Message-ID': 'foo'}
    (subject, from_email, to) = ('hello', 'from@example.com', '"S\xc3\xbcrname,    Firstname"    <to@example.com>')
    text_content = 'This    is    an    important    message.'
    html_content = '<p>This    is    an    <strong>important</strong>    message.</p>'
    msg = EmailMultiAlternatives('Message    from    Firstname    S\xc3\xbcrname', text_content, from_email, [to], headers=headers)
    msg.attach_alternative(html_content, 'text/html')
    msg.encoding = 'iso-8859-1'
    self.assertEqual(msg.message()['To'], '=?iso-8859-1?q?S=FCrname=2C_Firstname?=    <to@example.com>')
    self.assertEqual(msg.message()['Subject'].encode(), u'=?iso-8859-1?q?Message_from_Firstname_S=FCrname?=')
