'Test that CourseOverview handles courses with a malformed grading policy
such that course._grading_policy[\'GRADE_CUTOFFS\'] = {} by defaulting
.lowest_passing_grade to None.
Created in response to https://openedx.atlassian.net/browse/TNL-2806.'

def test_malformed_grading_policy(self):

    course = CourseFactory.create()
    course._grading_policy['GRADE_CUTOFFS'] = {}
    with self.assertRaises(ValueError):
        __ = course.lowest_passing_grade
    course_overview = CourseOverview._create_or_update(course)
    self.assertEqual(course_overview.lowest_passing_grade, None)
