コード例 #1
0
ファイル: test_api.py プロジェクト: uetuluk/edx-platform
 def test_with_downloadable_web_cert(self):
     cert_status = certificate_status_for_student(self.student, self.course.id)
     assert certificate_downloadable_status(self.student, self.course.id) ==\
            {'is_downloadable': True,
             'is_generating': False,
             'is_unverified': False,
             'download_url': f'/certificates/{cert_status["uuid"]}',
             'is_pdf_certificate': False,
             'uuid': cert_status['uuid']}
コード例 #2
0
    def test_certificate_status_for_student(self):
        student = UserFactory()
        course = CourseFactory.create(org='edx',
                                      number='verified',
                                      display_name='Verified Course')

        certificate_status = certificate_status_for_student(student, course.id)
        assert certificate_status['status'] == CertificateStatuses.unavailable
        assert certificate_status['mode'] == GeneratedCertificate.MODES.honor
コード例 #3
0
ファイル: helpers.py プロジェクト: patilswapnilv/edx-platform
def cert_info(user, enrollment):
    """
    Get the certificate info needed to render the dashboard section for the given
    student and course.

    Arguments:
        user (User): A user.
        enrollment (CourseEnrollment): A course enrollment.

    Returns:
        See _cert_info
    """
    return _cert_info(
        user,
        enrollment,
        certificate_status_for_student(user, enrollment.course_overview.id),
    )