当前位置: 首页>>代码示例>>Python>>正文


Python GroupConfiguration.update_usage_info方法代码示例

本文整理汇总了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)
开发者ID:AdityaKashyap,项目名称:edx-platform,代码行数:11,代码来源:test_group_configurations.py

示例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']
        )
开发者ID:CDOT-EDX,项目名称:edx-platform,代码行数:21,代码来源:test_group_configurations.py

示例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'
            }
        )
开发者ID:AdityaKashyap,项目名称:edx-platform,代码行数:26,代码来源:test_group_configurations.py


注:本文中的contentstore.views.course.GroupConfiguration.update_usage_info方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。