当前位置: 首页>>代码示例>>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;未经允许,请勿转载。