'Test that calling "manage.py send_mail" actually sends mail using the
specified MAILER_EMAIL_BACKEND'

def test_mailer_email_backend(self):

    with self.settings(MAILER_EMAIL_BACKEND=u'mailer.tests.TestMailerEmailBackend'):
        mailer.send_mail(u'Subject    \u263a', u'Body', u'sender1@example.com', [u'recipient@example.com'])
        self.assertEqual(Message.objects.count(), 1)
        self.assertEqual(len(TestMailerEmailBackend.outbox), 0)
        engine.send_all()
        self.assertEqual(len(TestMailerEmailBackend.outbox), 1)
        self.assertEqual(Message.objects.count(), 0)
        self.assertEqual(MessageLog.objects.count(), 1)
