'Test that mail is redirected to a dummy outbox during test setup'

def test_mail_sending(self):

    response = self.client.get(u'/test_client/mail_sending_view/')
    self.assertEqual(response.status_code, 200)
    self.assertEqual(len(mail.outbox), 1)
    self.assertEqual(mail.outbox[0].subject, u'Test    message')
    self.assertEqual(mail.outbox[0].body, u'This    is    a    test    email')
    self.assertEqual(mail.outbox[0].from_email, u'from@example.com')
    self.assertEqual(mail.outbox[0].to[0], u'first@example.com')
    self.assertEqual(mail.outbox[0].to[1], u'second@example.com')
