'Tests that the default cert info is returned
when the learner has no persisted grade or grade
in the certs table.'

def test_cert_grade_no_grades(self):

    user = Mock(username='fred', id='1')
    survey_url = 'http://a_survey.com'
    course = Mock(end_of_course_survey_url=survey_url, certificates_display_behavior='end', id=CourseLocator(org='x', course='y', run='z'))
    course_mode = 'honor'
    cert_status = {'status': 'generating', 'mode': 'honor'}
    with patch('lms.djangoapps.grades.new.course_grade_factory.CourseGradeFactory.read') as patch_persisted_grade:
        patch_persisted_grade.return_value = None
        self.assertEqual(_cert_info(user, course, cert_status, course_mode), {'status': 'processing', 'show_disabled_download_button': False, 'show_download_url': False, 'show_survey_button': False, 'can_unenroll': True})
