Esempio n. 1
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())
Esempio n. 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
Esempio n. 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
Esempio n. 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
Esempio n. 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
Esempio n. 6
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())
Esempio n. 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)
Esempio n. 8
0
 def test_no_mail_with_blank_recipients(self, Message, mail):
     mail_dict = dict(subject='Hello', recipients=[], body='Hello Pepito!')
     send_mail(mail_dict)