예제 #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())
예제 #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
예제 #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
예제 #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
예제 #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
예제 #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())
예제 #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)
예제 #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)