def test_send_mail_sends_mail(self, Message, mail): mail_dict = dict(subject='Hello', recipients=['*****@*****.**'], body='Hello Pepito!') send_mail(mail_dict) mail.send.assert_called_once_with(Message())
def test_send_mail_craetes_message(self, Message, mail): mail_dict = dict(subject='Hello', recipients=['*****@*****.**'], body='Hello Pepito!') send_mail(mail_dict) Message.assert_called_once_with(**mail_dict) assert mail.send.called
def test_send_mail_filters_spam_two_emails(self, Message, mail): mail_dict = dict(subject='Hello', recipients=['*****@*****.**', '*****@*****.**'], body='Hello Pepito!') send_mail(mail_dict) assert mail.send.called is False
def test_send_mail_sends_mail(self, Message, mail): mail_dict = dict(subject='Hello', recipients=['*****@*****.**'], body='Hello Pepito!') send_mail(mail_dict) mail.send.assert_called_once_with(Message()) assert mail.send.called
def test_send_mail_sends_mail(self, Message, mail): mail_dict = dict(subject="Hello", recipients=["*****@*****.**"], body="Hello Pepito!") send_mail(mail_dict) mail.send.assert_called_once_with(Message())
def test_send_mail_craetes_message(self, Message, mail): mail_dict = dict(subject='Hello', recipients=['*****@*****.**'], body='Hello Pepito!') send_mail(mail_dict) Message.assert_called_once_with(**mail_dict)
def test_no_mail_with_blank_recipients(self, Message, mail): mail_dict = dict(subject='Hello', recipients=[], body='Hello Pepito!') send_mail(mail_dict)