Beispiel #1
0
class SendTest(BaseTest):
    def setUp(self):
        super(SendTest, self).setUp()
        self.sender = Sender(self.config)

    @patch('smtplib.SMTP')
    @patch.object(SMTP, 'sendmail')
    def test_send(self, smtp, sendmail):
        msg = load_msg('sample')
        self.sender.send(msg, u'*****@*****.**')

        self.assertEqual(sendmail.call_count, 1)
        self.assertEqual(msg['To'], u'*****@*****.**')
        self.assertEqual(msg['From'], self.sender.get_address())
        self.assertEqual(msg['Reply-To'], self.sender.get_address())
        self.assertEqual(msg['Subject'], u'[Test] BETA 2.0')

    def test_get_address(self):
        self.assertEqual(self.sender.get_address(), self.config['sender'])
Beispiel #2
0
class SendTest(BaseTest):

    def setUp(self):
        super(SendTest,self).setUp()
        self.sender = Sender(self.config)

    @patch('smtplib.SMTP')
    @patch.object(SMTP, 'sendmail')
    def test_send(self, smtp, sendmail):
        msg = load_msg('sample')
        self.sender.send(msg, u'*****@*****.**')

        self.assertEqual(sendmail.call_count, 1)
        self.assertEqual(msg['To'], u'*****@*****.**')
        self.assertEqual(msg['From'], self.sender.get_address())
        self.assertEqual(msg['Reply-To'], self.sender.get_address())
        self.assertEqual(msg['Subject'], u'[Test] BETA 2.0')

    def test_get_address(self):
        self.assertEqual(self.sender.get_address(),self.config['sender'])
Beispiel #3
0
 def setUp(self):
     super(SendTest,self).setUp()
     self.sender = Sender(self.config)
Beispiel #4
0
 def setUp(self):
     super(SendTest, self).setUp()
     self.sender = Sender(self.config)