'Test that message-id is set and saved correctly'

def test_set_and_save_message_id(self):

    with self.settings(MAILER_EMAIL_BACKEND=u'mailer.tests.TestMailerEmailBackend'):
        mailer.send_mail(u'Subject', u'Body', u'sender@example.com', [u'recipient@example.com'])
        engine.send_all()
        m = MessageLog.objects.get()
        self.assertEqual(m.email.extra_headers[u'Message-ID'], m.message_id)
