コード例 #1
0
ファイル: test_utils.py プロジェクト: unicef/etools
 def test_send(self):
     intervention = InterventionFactory(status=Intervention.DRAFT)
     tz = timezone.get_default_timezone()
     intervention.created = datetime.datetime(2018, 1, 1, 12, 55, 12, 12345, tzinfo=tz)
     intervention.save()
     mock_send = Mock()
     with patch(self.send_path, mock_send):
         utils.send_intervention_draft_notification()
     self.assertEqual(mock_send.call_count, 1)
コード例 #2
0
ファイル: test_commands.py プロジェクト: unicef/etools
 def test_command(self):
     send_path = "etools.applications.partners.utils.send_notification_with_template"
     intervention = InterventionFactory(status=Intervention.DRAFT)
     tz = timezone.get_default_timezone()
     intervention.created = datetime.datetime(2018, 1, 1, 12, 55, 12, 12345, tzinfo=tz)
     intervention.save()
     mock_send = Mock()
     with patch(send_path, mock_send):
         call_command("send_intervention_draft_notification")
     self.assertEqual(mock_send.call_count, 1)
コード例 #3
0
 def test_send(self):
     intervention = InterventionFactory(status=Intervention.DRAFT)
     tz = timezone.get_default_timezone()
     intervention.created = datetime.datetime(2018,
                                              1,
                                              1,
                                              12,
                                              55,
                                              12,
                                              12345,
                                              tzinfo=tz)
     intervention.save()
     mock_send = Mock()
     with patch(self.send_path, mock_send):
         utils.send_intervention_draft_notification()
     self.assertEqual(mock_send.call_count, 1)
コード例 #4
0
ファイル: test_commands.py プロジェクト: azizur77/etools
 def test_command(self):
     send_path = "etools.applications.partners.utils.send_notification_with_template"
     intervention = InterventionFactory(status=Intervention.DRAFT)
     tz = timezone.get_default_timezone()
     intervention.created = datetime.datetime(2018,
                                              1,
                                              1,
                                              12,
                                              55,
                                              12,
                                              12345,
                                              tzinfo=tz)
     intervention.save()
     mock_send = Mock()
     with patch(send_path, mock_send):
         call_command("send_intervention_draft_notification")
     self.assertEqual(mock_send.call_count, 1)