Exemplo n.º 1
0
 def _test_fail_send_mail_notify(self, mock_send_mail):
     mock_send_mail.side_effect = Exception('Boom!')
     self.assertFalse(mock_send_mail.called)
     result = send_mail.notify(self.user, self.scan.scan_task.target,
                               self.scan.id)
     self.assertTrue(mock_send_mail.called)
     self.assertFalse(result)
Exemplo n.º 2
0
 def test_notify(self):
     # Empty the test outbox
     mail.outbox = []
     result = send_mail.notify(self.user, self.scan.scan_task.target,
                               self.scan.id)
     self.assertEqual(len(mail.outbox), 1)
     self.assertTrue(result)
Exemplo n.º 3
0
 def _test_fail_send_mail_notify(self, mock_send_mail):
     mock_send_mail.side_effect =  Exception('Boom!')
     self.assertFalse(mock_send_mail.called)
     result = send_mail.notify(self.user,
                               self.scan.scan_task.target,
                               self.scan.id)
     self.assertTrue(mock_send_mail.called)
     self.assertFalse(result)
Exemplo n.º 4
0
 def test_notify(self):
     # Empty the test outbox
     mail.outbox = []
     result = send_mail.notify(self.user,
                               self.scan.scan_task.target,
                               self.scan.id)
     self.assertEqual(len(mail.outbox), 1)
     self.assertTrue(result)