示例#1
0
 def test_programs_disabled(self, mock_is_learner_issuance_enabled, mock_task):
     """
     Ensures that the receiver function does nothing when the credentials API
     configuration is not enabled.
     """
     handle_course_cert_date_change(**self.signal_kwargs)
     self.assertEqual(mock_is_learner_issuance_enabled.call_count, 1)
     self.assertEqual(mock_task.call_count, 0)
示例#2
0
 def test_programs_disabled(self, mock_enable_update,
                            mock_is_learner_issuance_enabled, mock_task):
     """
     Ensures that the receiver function does nothing when the credentials API
     configuration is not enabled.
     """
     mock_enable_update.return_value = True
     handle_course_cert_date_change(**self.signal_kwargs)
     assert mock_is_learner_issuance_enabled.call_count == 1
     assert mock_task.call_count == 0
示例#3
0
    def test_programs_enabled(self, mock_is_learner_issuance_enabled, mock_task):
        """
        Ensures that the receiver function invokes the expected celery task
        when the credentials API configuration is enabled.
        """
        mock_is_learner_issuance_enabled.return_value = True

        handle_course_cert_date_change(**self.signal_kwargs)

        self.assertEqual(mock_is_learner_issuance_enabled.call_count, 1)
        self.assertEqual(mock_task.call_count, 1)