本文整理汇总了Python中contentstore.views.course.GroupConfiguration.update_usage_info方法的典型用法代码示例。如果您正苦于以下问题:Python GroupConfiguration.update_usage_info方法的具体用法?Python GroupConfiguration.update_usage_info怎么用?Python GroupConfiguration.update_usage_info使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类contentstore.views.course.GroupConfiguration
的用法示例。
在下文中一共展示了GroupConfiguration.update_usage_info方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_update_usage_info_no_message
# 需要导入模块: from contentstore.views.course import GroupConfiguration [as 别名]
# 或者: from contentstore.views.course.GroupConfiguration import update_usage_info [as 别名]
def test_update_usage_info_no_message(self, mocked_validation_messages):
"""
Tests if validation message is not present when updating usage info.
"""
self._add_user_partitions()
self._create_content_experiment(cid=0, name_suffix='0')
mocked_validation_messages.return_value = []
group_configuration = GroupConfiguration.update_usage_info(self.store, self.course, self.course.user_partitions[0])
self.assertEqual(group_configuration['usage'][0]['validation'], None)
示例2: verify_validation_update_usage_info
# 需要导入模块: from contentstore.views.course import GroupConfiguration [as 别名]
# 或者: from contentstore.views.course.GroupConfiguration import update_usage_info [as 别名]
def verify_validation_update_usage_info(self, expected_result, mocked_message, mocked_validation_messages):
"""
Helper method for testing validation information present after update_usage_info.
"""
self._add_user_partitions()
split_test = self._create_content_experiment(cid=0, name_suffix='0')[1]
validation = StudioValidation(split_test.location)
if mocked_message is not None:
validation.add(mocked_message)
mocked_validation_messages.return_value = validation
group_configuration = GroupConfiguration.update_usage_info(
self.store, self.course, self.course.user_partitions[0]
)
self.assertEqual(
expected_result.to_json() if expected_result is not None else None,
group_configuration['usage'][0]['validation']
)
示例3: test_update_usage_info
# 需要导入模块: from contentstore.views.course import GroupConfiguration [as 别名]
# 或者: from contentstore.views.course.GroupConfiguration import update_usage_info [as 别名]
def test_update_usage_info(self, mocked_validation_messages):
"""
Tests if validation message is present when updating usage info.
"""
self._add_user_partitions()
split_test = self._create_content_experiment(cid=0, name_suffix='0')[1]
mocked_validation_messages.return_value = [
ValidationMessage(
split_test,
u"Validation message",
ValidationMessageType.warning
)
]
group_configuration = GroupConfiguration.update_usage_info(self.store, self.course, self.course.user_partitions[0])
self.assertEqual(
group_configuration['usage'][0]['validation'],
{
'message': u'This content experiment has issues that affect content visibility.',
'type': 'warning'
}
)