'Test that adding credit requirements is retried when
\'InvalidCreditRequirements\' exception is raised.
Make sure that the receiver correctly fires off the task when
invoked by signal'

@mock.patch('openedx.core.djangoapps.credit.tasks.set_credit_requirements', mock.Mock(side_effect=mocked_set_credit_requirements))
def test_retry(self):

    self.add_credit_course(self.course.id)
    requirements = get_credit_requirements(self.course.id)
    self.assertEqual(len(requirements), 0)
    on_course_publish(self.course.id)
    requirements = get_credit_requirements(self.course.id)
    self.assertEqual(len(requirements), 0)
