Пример #1
0
 def test_invalid_no_to(self):
     """Test that sending an invalid email (no to) raises the appropriate exception
     """
     _td = _test_data()
     del _td['to']
     with self.assertRaises(mail.MissingRecipientsError):
         mail.send(**_td)
Пример #2
0
 def test_invalid_no_to(self):
     """Test that sending an invalid email (no to) raises the appropriate exception
     """
     _td = _test_data()
     del _td['to']
     with self.assertRaises(mail.MissingRecipientsError):
         mail.send(**_td)
Пример #3
0
 def test_invalid_no_sender(self):
     """Test that sending an invalid email (no sender) raises the appropriate exception
     """
     _td = _test_data()
     del _td['sender']
     with self.assertRaises(mail.MissingSenderError):
         mail.send(**_td)
Пример #4
0
 def test_invalid_no_sender(self):
     """Test that sending an invalid email (no sender) raises the appropriate exception
     """
     _td = _test_data()
     del _td['sender']
     with self.assertRaises(mail.MissingSenderError):
         mail.send(**_td)
Пример #5
0
    def test_valid_email_empty_body(self):
        """Test that sending a valid email (with an empty body) succeeds
        """
        mail.send(**_test_data(body=''))

        messages = self.mail_stub.get_sent_messages()
        self.assertEqual(1, len(messages))
        self.assertEqual('*****@*****.**', messages[0].to)
Пример #6
0
    def test_valid_email_empty_body(self):
        """Test that sending a valid email (with an empty body) succeeds
        """
        mail.send(**_test_data(body=''))

        messages = self.mail_stub.get_sent_messages()
        self.assertEqual(1, len(messages))
        self.assertEqual('*****@*****.**', messages[0].to)
Пример #7
0
    def test_valid_email_no_body(self):
        """Test that sending a valid email (with no body) succeeds
        """
        _td = _test_data()
        del _td['body']
        mail.send(**_td)

        messages = self.mail_stub.get_sent_messages()
        self.assertEqual(1, len(messages))
        self.assertEqual('*****@*****.**', messages[0].to)
Пример #8
0
    def test_valid_email_no_body(self):
        """Test that sending a valid email (with no body) succeeds
        """
        _td = _test_data()
        del _td['body']
        mail.send(**_td)

        messages = self.mail_stub.get_sent_messages()
        self.assertEqual(1, len(messages))
        self.assertEqual('*****@*****.**', messages[0].to)
Пример #9
0
 def test_invalid_email_empty_to(self):
     """Test that sending an invalid email (empty to) raises the appropriate exception
     """
     _td = _test_data(to='')
     with self.assertRaises(mail.InvalidEmailError):
         mail.send(**_td)
Пример #10
0
 def test_invalid_email_empty_to(self):
     """Test that sending an invalid email (empty to) raises the appropriate exception
     """
     _td = _test_data(to='')
     with self.assertRaises(mail.InvalidEmailError):
         mail.send(**_td)