modify doc strings.
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
Acceptance tests for the certificate web view feature.
|
||||
"""
|
||||
from nose.plugins.attrib import attr
|
||||
|
||||
from common.test.acceptance.fixtures.certificates import CertificateConfigFixture
|
||||
from common.test.acceptance.fixtures.course import CourseFixture, CourseUpdateDesc, XBlockFixtureDesc
|
||||
from common.test.acceptance.pages.lms.auto_auth import AutoAuthPage
|
||||
@@ -22,6 +23,7 @@ from common.test.acceptance.tests.helpers import (
|
||||
get_modal_alert,
|
||||
)
|
||||
|
||||
|
||||
@attr(shard=5)
|
||||
class CertificateWebViewTest(EventsTestMixin, UniqueCourseTest):
|
||||
"""
|
||||
|
||||
@@ -1,25 +1,27 @@
|
||||
""" Signal handler for enabling self-generated certificates for self-paced
|
||||
courses and disabling for instructor-paced courses.
|
||||
"""
|
||||
Signal handler for enabling/disabling self-generated certificates based on the course-pacing.
|
||||
"""
|
||||
from celery.task import task
|
||||
from django.dispatch.dispatcher import receiver
|
||||
|
||||
from certificates.models import CertificateGenerationCourseSetting
|
||||
from opaque_keys.edx.keys import CourseKey
|
||||
from xmodule.modulestore.django import SignalHandler, modulestore
|
||||
from xmodule.modulestore.django import modulestore, SignalHandler
|
||||
|
||||
|
||||
@receiver(SignalHandler.course_published)
|
||||
def _listen_for_course_publish(sender, course_key, **kwargs): # pylint: disable=unused-argument
|
||||
""" Catches the signal that a course has been published in Studio and
|
||||
enable/disable the self-generated certificates for courses according to pacing.
|
||||
enable/disable the self-generated certificates according to course-pacing.
|
||||
"""
|
||||
set_self_generated_certs.delay(unicode(course_key))
|
||||
|
||||
|
||||
@task()
|
||||
def set_self_generated_certs(course_key):
|
||||
"""Enable or disable self-generated certificates for a course according to pacing."""
|
||||
"""
|
||||
Enable or disable self-generated certificates for a course according to pacing.
|
||||
"""
|
||||
course_key = CourseKey.from_string(course_key)
|
||||
course = modulestore().get_course(course_key)
|
||||
CertificateGenerationCourseSetting.set_enabled_for_course(course_key, course.self_paced)
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
""" Unit tests for enabling self-generated certificates for
|
||||
self-paced courses and disabling for instructor-paced courses.
|
||||
"""
|
||||
Unit tests for enabling self-generated certificates for self-paced courses
|
||||
and disabling for instructor-paced courses.
|
||||
"""
|
||||
from certificates import api as certs_api
|
||||
from certificates.models import CertificateGenerationConfiguration
|
||||
@@ -10,8 +11,8 @@ from xmodule.modulestore.tests.django_utils import ModuleStoreTestCase
|
||||
|
||||
|
||||
class SelfGeneratedCertsSignalTest(ModuleStoreTestCase):
|
||||
""" Tests for enabling/disabling self-generated certificates
|
||||
according to pacing.
|
||||
"""
|
||||
Tests for enabling/disabling self-generated certificates according to course-pacing.
|
||||
"""
|
||||
|
||||
def setUp(self):
|
||||
|
||||
Reference in New Issue
Block a user