'Ensures that the receiver function invokes the expected celery task
when the credentials API configuration is enabled.'

def test_programs_enabled(self, mock_is_learner_issuance_enabled, mock_task):

    mock_is_learner_issuance_enabled.return_value = True
    handle_course_cert_awarded(**self.signal_kwargs)
    self.assertEqual(mock_is_learner_issuance_enabled.call_count, 1)
    self.assertEqual(mock_task.call_count, 1)
    self.assertEqual(mock_task.call_args[0], (TEST_USERNAME,))
