'Verify the endpoint returns HTTP 400 if the user is not eligible for credit for the course.'

def test_post_user_not_eligible(self):

    credit_course = CreditCourseFactory()
    username = u'ineligible-user'
    course_key = credit_course.course_key
    response = self.post_credit_request(username, course_key)
    msg = u'[{username}]    is    not    eligible    for    credit    for    [{course_key}].'.format(username=username, course_key=course_key)
    self.assert_error_response(response, msg)
