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

def test_safe_mime_multipart(self):

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