当前位置: 首页>>代码示例>>Python>>正文


Python models.ExampleCertificateSet类代码示例

本文整理汇总了Python中certificates.models.ExampleCertificateSet的典型用法代码示例。如果您正苦于以下问题:Python ExampleCertificateSet类的具体用法?Python ExampleCertificateSet怎么用?Python ExampleCertificateSet使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了ExampleCertificateSet类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: example_certificates_status

def example_certificates_status(course_key):
    """Check the status of example certificates for a course.

    This will check the *latest* example certificate task.
    This is generally what we care about in terms of enabling/disabling
    self-generated certificates for a course.

    Arguments:
        course_key (CourseKey): The course identifier.

    Returns:
        list

    Example Usage:

        >>> from certificates import api as certs_api
        >>> certs_api.example_certificate_status(course_key)
        [
            {
                'description': 'honor',
                'status': 'success',
                'download_url': 'http://www.example.com/abcd/honor_cert.pdf'
            },
            {
                'description': 'verified',
                'status': 'error',
                'error_reason': 'No template found!'
            }
        ]

    """
    return ExampleCertificateSet.latest_status(course_key)
开发者ID:chauhanhardik,项目名称:populo,代码行数:32,代码来源:api.py

示例2: test_latest_status_unavailable

    def test_latest_status_unavailable(self):
        # Delete any existing statuses
        ExampleCertificateSet.objects.all().delete()

        # Verify that the "latest" status is None
        result = ExampleCertificateSet.latest_status(self.COURSE_KEY)
        self.assertIs(result, None)
开发者ID:AndreySonetico,项目名称:edx-platform,代码行数:7,代码来源:test_models.py

示例3: generate_example_certificates

def generate_example_certificates(course_key):
    """Generate example certificates for a course.

    Example certificates are used to validate that certificates
    are configured correctly for the course.  Staff members can
    view the example certificates before enabling
    the self-generated certificates button for students.

    Several example certificates may be generated for a course.
    For example, if a course offers both verified and honor certificates,
    examples of both types of certificate will be generated.

    If an error occurs while starting the certificate generation
    job, the errors will be recorded in the database and
    can be retrieved using `example_certificate_status()`.

    Arguments:
        course_key (CourseKey): The course identifier.

    Returns:
        None

    """
    xqueue = XQueueCertInterface()
    for cert in ExampleCertificateSet.create_example_set(course_key):
        xqueue.add_example_cert(cert)
开发者ID:chauhanhardik,项目名称:populo,代码行数:26,代码来源:api.py

示例4: test_latest_status_is_course_specific

 def test_latest_status_is_course_specific(self):
     other_course = CourseLocator(org='other', course='other', run='other')
     result = ExampleCertificateSet.latest_status(other_course)
     self.assertIs(result, None)
开发者ID:AndreySonetico,项目名称:edx-platform,代码行数:4,代码来源:test_models.py


注:本文中的certificates.models.ExampleCertificateSet类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。