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


Python CourseGradingModel.delete_grace_period方法代码示例

本文整理汇总了Python中models.settings.course_grading.CourseGradingModel.delete_grace_period方法的典型用法代码示例。如果您正苦于以下问题:Python CourseGradingModel.delete_grace_period方法的具体用法?Python CourseGradingModel.delete_grace_period怎么用?Python CourseGradingModel.delete_grace_period使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在models.settings.course_grading.CourseGradingModel的用法示例。


在下文中一共展示了CourseGradingModel.delete_grace_period方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: test_delete_grace_period

# 需要导入模块: from models.settings.course_grading import CourseGradingModel [as 别名]
# 或者: from models.settings.course_grading.CourseGradingModel import delete_grace_period [as 别名]
    def test_delete_grace_period(self):
        test_grader = CourseGradingModel.fetch(self.course.location)
        CourseGradingModel.update_grace_period_from_json(test_grader.course_location, test_grader.grace_period)
        # update_grace_period_from_json doesn't return anything, so query the db for its contents.
        altered_grader = CourseGradingModel.fetch(self.course.location)
        self.assertEqual(test_grader.grace_period, altered_grader.grace_period, "Noop update")

        test_grader.grace_period = {'hours': 15, 'minutes': 5, 'seconds': 30}
        CourseGradingModel.update_grace_period_from_json(test_grader.course_location, test_grader.grace_period)
        altered_grader = CourseGradingModel.fetch(self.course.location)
        self.assertDictEqual(test_grader.grace_period, altered_grader.grace_period, "Adding in a grace period")

        test_grader.grace_period = {'hours': 1, 'minutes': 10, 'seconds': 0}
        # Now delete the grace period
        CourseGradingModel.delete_grace_period(test_grader.course_location)
        # update_grace_period_from_json doesn't return anything, so query the db for its contents.
        altered_grader = CourseGradingModel.fetch(self.course.location)
        # Once deleted, the grace period should simply be None
        self.assertEqual(None, altered_grader.grace_period, "Delete grace period")
开发者ID:AzizYosofi,项目名称:edx-platform,代码行数:21,代码来源:test_course_settings.py

示例2: test_delete_grace_period

# 需要导入模块: from models.settings.course_grading import CourseGradingModel [as 别名]
# 或者: from models.settings.course_grading.CourseGradingModel import delete_grace_period [as 别名]
    def test_delete_grace_period(self):
        test_grader = CourseGradingModel.fetch(self.course.id)
        CourseGradingModel.update_grace_period_from_json(self.course.id, test_grader.grace_period, self.user)
        # update_grace_period_from_json doesn't return anything, so query the db for its contents.
        altered_grader = CourseGradingModel.fetch(self.course.id)
        self.assertEqual(test_grader.grace_period, altered_grader.grace_period, "Noop update")

        test_grader.grace_period = {"hours": 15, "minutes": 5, "seconds": 30}
        CourseGradingModel.update_grace_period_from_json(self.course.id, test_grader.grace_period, self.user)
        altered_grader = CourseGradingModel.fetch(self.course.id)
        self.assertDictEqual(test_grader.grace_period, altered_grader.grace_period, "Adding in a grace period")

        test_grader.grace_period = {"hours": 1, "minutes": 10, "seconds": 0}
        # Now delete the grace period
        CourseGradingModel.delete_grace_period(self.course.id, self.user)
        # update_grace_period_from_json doesn't return anything, so query the db for its contents.
        altered_grader = CourseGradingModel.fetch(self.course.id)
        # Once deleted, the grace period should simply be None
        self.assertEqual(None, altered_grader.grace_period, "Delete grace period")
开发者ID:GeertHa,项目名称:edx-platform,代码行数:21,代码来源:test_course_settings.py


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