'Verify that the Request Certificate is not displayed in audit mode.'

@patch('lms.djangoapps.grades.new.course_grade.CourseGrade.summary', PropertyMock(return_value={'grade': 'Pass', 'percent': 0.75, 'section_breakdown': [], 'grade_breakdown': {}}))
@ddt.data(*itertools.product((CourseMode.AUDIT, CourseMode.HONOR, CourseMode.VERIFIED, CourseMode.PROFESSIONAL, CourseMode.NO_ID_PROFESSIONAL_MODE, CourseMode.CREDIT_MODE), (True, False)))
@ddt.unpack
def test_show_certificate_request_button(self, course_mode, user_verified):

    CertificateGenerationConfiguration(enabled=True).save()
    certs_api.set_cert_generation_enabled(self.course.id, True)
    CourseEnrollment.enroll(self.user, self.course.id, mode=course_mode)
    with patch('lms.djangoapps.verify_student.models.SoftwareSecurePhotoVerification.user_is_verified') as user_verify:
        user_verify.return_value = user_verified
        resp = self.client.get(reverse('progress', args=[unicode(self.course.id)]))
        cert_button_hidden = ((course_mode is CourseMode.AUDIT) or ((course_mode in CourseMode.VERIFIED_MODES) and (not user_verified)))
        self.assertEqual(cert_button_hidden, ('Request    Certificate' not in resp.content))
