'Test that using send_mail creates a Message object in DB instead, when EMAIL_BACKEND is set.'

def test_save_to_db(self):

    self.assertEqual(Message.objects.count(), 0)
    with self.settings(EMAIL_BACKEND=u'mailer.backend.DbBackend'):
        mail.send_mail(u'Subject    \u263a', u'Body', u'sender@example.com', [u'recipient@example.com'])
        self.assertEqual(Message.objects.count(), 1)
