Beispiel #1
0
 def test_send_moderation_mail(self, mock_f):
     """ if there is something to moderate, send mail"""
     self.host.approved = False
     self.host.save()
     send_moderation_nag_mail()
     self.assertTrue(mock_f.called)
     mail_body = mock_f.call_args[0][1]
     mail_to = mock_f.call_args[0][3]
     self.assertTrue(
         reverse("fwadmin:moderator_list_unapproved") in mail_body)
     self.assertTrue(
         "\ntest (192.168.1.1)" in mail_body)
     self.assertEqual(mail_to, [FWADMIN_MODERATION_WAITING_MAIL_NAG])
Beispiel #2
0
 def test_no_send_moderation_mail(self, mock_f):
     """ if there are no hosts to moderate, do not send mail"""
     send_moderation_nag_mail()
     self.assertFalse(mock_f.called)