'Test to ensure a grade can ba calculated for a student in a course, even if they themselves do not have access.'

def test_course_grade_no_access(self):

    invisible_course = CourseFactory.create(visible_to_staff_only=True)
    access = has_access(self.request.user, 'load', invisible_course)
    self.assertEqual(access.has_access, False)
    self.assertEqual(access.error_code, 'not_visible_to_user')
    grade = CourseGradeFactory().create(self.request.user, invisible_course)
    self.assertEqual(grade.percent, 0)
