'Simulate that the user has a generated certificate.'

def _create_certificate(self, enrollment_mode):

    CourseEnrollmentFactory.create(user=self.user, course_id=self.course.id, mode=enrollment_mode)
    return GeneratedCertificateFactory(user=self.user, course_id=self.course.id, mode=enrollment_mode, download_url=self.DOWNLOAD_URL, status='downloadable', grade=0.98)
