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())
Exemple #2
0
 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
Exemple #3
0
    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
Exemple #4
0
    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
Exemple #5
0
    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())
Exemple #7
0
 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)