當前位置: 首頁>>代碼示例>>Python>>正文


Python XMODULE_FACTORY_LOCK.disable方法代碼示例

本文整理匯總了Python中xmodule.modulestore.tests.factories.XMODULE_FACTORY_LOCK.disable方法的典型用法代碼示例。如果您正苦於以下問題:Python XMODULE_FACTORY_LOCK.disable方法的具體用法?Python XMODULE_FACTORY_LOCK.disable怎麽用?Python XMODULE_FACTORY_LOCK.disable使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在xmodule.modulestore.tests.factories.XMODULE_FACTORY_LOCK的用法示例。


在下文中一共展示了XMODULE_FACTORY_LOCK.disable方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: tearDownClass

# 需要導入模塊: from xmodule.modulestore.tests.factories import XMODULE_FACTORY_LOCK [as 別名]
# 或者: from xmodule.modulestore.tests.factories.XMODULE_FACTORY_LOCK import disable [as 別名]
    def tearDownClass(cls):
        drop_mongo_collections()  # pylint: disable=no-value-for-parameter
        RequestCache().clear_request_cache()
        XMODULE_FACTORY_LOCK.disable()
        cls._settings_override.__exit__(None, None, None)

        super(SharedModuleStoreTestCase, cls).tearDownClass()
開發者ID:Edraak,項目名稱:edx-platform,代碼行數:9,代碼來源:django_utils.py

示例2: end_modulestore_isolation

# 需要導入模塊: from xmodule.modulestore.tests.factories import XMODULE_FACTORY_LOCK [as 別名]
# 或者: from xmodule.modulestore.tests.factories.XMODULE_FACTORY_LOCK import disable [as 別名]
    def end_modulestore_isolation(cls):
        """
        Delete all content in the Modulestore, and reset the Modulestore
        settings from before :py:meth:`start_modulestore_isolation` was
        called.
        """
        drop_mongo_collections()  # pylint: disable=no-value-for-parameter
        XMODULE_FACTORY_LOCK.disable()
        cls.__settings_overrides.pop().__exit__(None, None, None)

        assert settings.MODULESTORE == cls.__old_modulestores.pop()
        cls.end_cache_isolation()
開發者ID:10clouds,項目名稱:edx-platform,代碼行數:14,代碼來源:django_utils.py

示例3: handle

# 需要導入模塊: from xmodule.modulestore.tests.factories import XMODULE_FACTORY_LOCK [as 別名]
# 或者: from xmodule.modulestore.tests.factories.XMODULE_FACTORY_LOCK import disable [as 別名]
    def handle(self, *args, **options):
        courses = modulestore().get_courses()

        # Find the largest auto-generated course, and pick the next sequence id to generate the next
        # course with.
        max_org_sequence_id = max([0] + [int(course.org[4:]) for course in courses if course.org.startswith('org.')])

        XMODULE_FACTORY_LOCK.enable()
        CourseFactory.reset_sequence(max_org_sequence_id + 1, force=True)
        course = CourseFactory.create(
            start=datetime.datetime.today() - datetime.timedelta(days=30),
            end=datetime.datetime.today() + datetime.timedelta(days=30),
            number=factory.Sequence('schedules_test_course_{}'.format),
            display_name=factory.Sequence(u'Schedules Test Course {}'.format),
        )
        XMODULE_FACTORY_LOCK.disable()
        course_overview = CourseOverview.load_from_module_store(course.id)
        CourseModeFactory.create(course_id=course_overview.id, mode_slug=CourseMode.AUDIT)
        CourseModeFactory.create(course_id=course_overview.id, mode_slug=CourseMode.VERIFIED)
        CourseDurationLimitExpirySchedule.create_batch(20, enrollment__course=course_overview)

        ScheduleConfigFactory.create(site=Site.objects.get(name='example.com'))
開發者ID:jolyonb,項目名稱:edx-platform,代碼行數:24,代碼來源:cdl_setup_models_to_send_test_emails.py

示例4: handle

# 需要導入模塊: from xmodule.modulestore.tests.factories import XMODULE_FACTORY_LOCK [as 別名]
# 或者: from xmodule.modulestore.tests.factories.XMODULE_FACTORY_LOCK import disable [as 別名]
    def handle(self, *args, **options):
        courses = modulestore().get_courses()

        # Find the largest auto-generated course, and pick the next sequence id to generate the next
        # course with.
        max_org_sequence_id = max(int(course.org[4:]) for course in courses if course.org.startswith('org.'))

        XMODULE_FACTORY_LOCK.enable()
        CourseFactory.reset_sequence(max_org_sequence_id + 1, force=True)
        course = CourseFactory.create(
            start=datetime.datetime.today() - datetime.timedelta(days=30),
            end=datetime.datetime.today() + datetime.timedelta(days=30),
            number=factory.Sequence('schedules_test_course_{}'.format),
            display_name=factory.Sequence('Schedules Test Course {}'.format),
        )
        XMODULE_FACTORY_LOCK.disable()
        course_overview = CourseOverview.load_from_module_store(course.id)
        ThreeDayNudgeSchedule.create(enrollment__course=course_overview)
        TenDayNudgeSchedule.create(enrollment__course=course_overview)
        UpgradeReminderSchedule.create(enrollment__course=course_overview)
        ContentHighlightSchedule.create(enrollment__course=course_overview)

        ScheduleConfigFactory.create(site=Site.objects.get(name='example.com'))
開發者ID:cmscom,項目名稱:edx-platform,代碼行數:25,代碼來源:setup_models_to_send_test_emails.py


注:本文中的xmodule.modulestore.tests.factories.XMODULE_FACTORY_LOCK.disable方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。