本文整理汇总了Python中contentstore.views.course.GroupConfiguration.get_usage_info方法的典型用法代码示例。如果您正苦于以下问题:Python GroupConfiguration.get_usage_info方法的具体用法?Python GroupConfiguration.get_usage_info怎么用?Python GroupConfiguration.get_usage_info使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类contentstore.views.course.GroupConfiguration
的用法示例。
在下文中一共展示了GroupConfiguration.get_usage_info方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_can_handle_without_parent
# 需要导入模块: from contentstore.views.course import GroupConfiguration [as 别名]
# 或者: from contentstore.views.course.GroupConfiguration import get_usage_info [as 别名]
def test_can_handle_without_parent(self):
"""
Test if it possible to handle case when split_test has no parent.
"""
self._add_user_partitions()
# Create split test without parent.
ItemFactory.create(
category='split_test',
user_partition_id=0,
display_name='Test Content Experiment'
)
self.save_course()
actual = GroupConfiguration.get_usage_info(self.course, self.store)
self.assertEqual(actual, {0: []})
示例2: test_can_handle_without_parent
# 需要导入模块: from contentstore.views.course import GroupConfiguration [as 别名]
# 或者: from contentstore.views.course.GroupConfiguration import get_usage_info [as 别名]
def test_can_handle_without_parent(self):
"""
Test if it possible to handle case when split_test has no parent.
"""
self._add_user_partitions()
# Create split test without parent.
with modulestore().branch_setting(ModuleStoreEnum.Branch.published_only):
orphan = modulestore().create_item(
ModuleStoreEnum.UserID.test,
self.course.id, 'split_test',
)
orphan.user_partition_id = 0
orphan.display_name = 'Test Content Experiment'
modulestore().update_item(orphan, ModuleStoreEnum.UserID.test)
self.save_course()
actual = GroupConfiguration.get_usage_info(self.course, self.store)
self.assertEqual(actual, {0: []})