Ejemplo n.º 1
0
    def test_send_mail_logs_exception(self, warning, send_mail):
        send_mail.side_effect = Exception('oh noes')

        views._send_welcome_email('*****@*****.**', 'john doe')

        warning.assert_called_with(
            'Error sending email: oh noes'
        )
Ejemplo n.º 2
0
    def test_send_mail(self, get_template, send_mail):

        get_template().render.return_value = 'email content'

        views._send_welcome_email('*****@*****.**', 'john doe')

        send_mail.assert_called_with(
            _('Welcome to Niqels!'),
            'email content',
            '*****@*****.**',
            ['*****@*****.**'],
            fail_silently=False
        )