'Happy path through the service'

def test_get_and_set_credit_state(self):

    self.assertTrue(self.service.is_credit_course(self.course.id))
    self.enroll()
    set_credit_requirements(self.course.id, [{'namespace': 'grade', 'name': 'grade', 'display_name': 'Grade', 'criteria': {'min_grade': 0.8}}])
    self.service.set_credit_requirement_status(self.user.id, self.course.id, 'grade', 'grade')
    credit_state = self.service.get_credit_state(self.user.id, self.course.id)
    self.assertIsNotNone(credit_state)
    self.assertTrue(credit_state['is_credit_course'])
    self.assertEqual(credit_state['enrollment_mode'], 'verified')
    self.assertEqual(credit_state['profile_fullname'], 'Foo    Bar')
    self.assertEqual(len(credit_state['credit_requirement_status']), 1)
    self.assertEqual(credit_state['credit_requirement_status'][0]['name'], 'grade')
    self.assertEqual(credit_state['credit_requirement_status'][0]['status'], 'satisfied')
