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'])
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'])
def setUp(self): super(SendTest,self).setUp() self.sender = Sender(self.config)
def setUp(self): super(SendTest, self).setUp() self.sender = Sender(self.config)