本文整理汇总了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()
示例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()
示例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'))
示例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'))