本文整理匯總了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'))