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


Python CreditCourse.save方法代码示例

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


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

示例1: add_credit_course

# 需要导入模块: from openedx.core.djangoapps.credit.models import CreditCourse [as 别名]
# 或者: from openedx.core.djangoapps.credit.models.CreditCourse import save [as 别名]
 def add_credit_course(self, enabled=True):
     """
     Mark the course as a credit.
     """
     credit_course = CreditCourse(course_key=self.course_key, enabled=enabled)
     credit_course.save()
     return credit_course
开发者ID:mtorrisi,项目名称:edx-platform,代码行数:9,代码来源:test_api.py

示例2: test_course_details_with_enabled_setting

# 需要导入模块: from openedx.core.djangoapps.credit.models import CreditCourse [as 别名]
# 或者: from openedx.core.djangoapps.credit.models.CreditCourse import save [as 别名]
    def test_course_details_with_enabled_setting(self):
        """
        Test that credit eligibility requirements are present in
        response if the feature flag 'ENABLE_CREDIT_ELIGIBILITY' is enabled.
        """
        # verify that credit eligibility requirements block don't show if the
        # course is not set as credit course
        response = self.client.get_html(self.course_details_url)
        self.assertEqual(response.status_code, 200)
        self.assertNotContains(response, "Course Credit Requirements")
        self.assertNotContains(response, "Steps required to earn course credit")

        # verify that credit eligibility requirements block shows if the
        # course is set as credit course and it has eligibility requirements
        credit_course = CreditCourse(course_key=unicode(self.course.id), enabled=True)
        credit_course.save()
        self.assertEqual(len(get_credit_requirements(self.course.id)), 0)
        # test that after publishing course, minimum grade requirement is added
        on_course_publish(self.course.id)
        self.assertEqual(len(get_credit_requirements(self.course.id)), 1)

        response = self.client.get_html(self.course_details_url)
        self.assertEqual(response.status_code, 200)
        self.assertContains(response, "Course Credit Requirements")
        self.assertContains(response, "Steps required to earn course credit")
开发者ID:AlexxNica,项目名称:edx-platform,代码行数:27,代码来源:test_credit_eligibility.py

示例3: add_credit_course

# 需要导入模块: from openedx.core.djangoapps.credit.models import CreditCourse [as 别名]
# 或者: from openedx.core.djangoapps.credit.models.CreditCourse import save [as 别名]
    def add_credit_course(self):
        """ Add the course as a credit

        Returns:
            CreditCourse object
        """
        credit_course = CreditCourse(course_key=self.course_key, enabled=True)
        credit_course.save()
        return credit_course
开发者ID:ahmadiga,项目名称:min_edx,代码行数:11,代码来源:test_models.py

示例4: add_credit_course

# 需要导入模块: from openedx.core.djangoapps.credit.models import CreditCourse [as 别名]
# 或者: from openedx.core.djangoapps.credit.models.CreditCourse import save [as 别名]
    def add_credit_course(self, course_key):
        """Add the course as a credit.

        Args:
            course_key(CourseKey): Identifier for the course

        Returns:
            CreditCourse object added
        """
        credit_course = CreditCourse(course_key=course_key, enabled=True)
        credit_course.save()
        return credit_course
开发者ID:digitalsatori,项目名称:edx-platform,代码行数:14,代码来源:test_tasks.py


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