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


Python CourseFactory.build方法代码示例

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


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

示例1: test_available_sections

# 需要导入模块: from courses.tests.factories import CourseFactory [as 别名]
# 或者: from courses.tests.factories.CourseFactory import build [as 别名]
 def test_available_sections(self):
     course = CourseFactory.build()
     queryset = models.Course.sections.by_availability = Mock(return_value='foobar')
     self.assertEqual('foobar', course.available_sections)
     queryset.assert_called_with()
开发者ID:Lucky1313,项目名称:YACS,代码行数:7,代码来源:models.py

示例2: test_credits_display_for_range

# 需要导入模块: from courses.tests.factories import CourseFactory [as 别名]
# 或者: from courses.tests.factories.CourseFactory import build [as 别名]
 def test_credits_display_for_range(self):
     course = CourseFactory.build(min_credits=1, max_credits=8)
     self.assertEqual('1 - 8 credits', course.credits_display)
开发者ID:Lucky1313,项目名称:YACS,代码行数:5,代码来源:models.py

示例3: test_credits_display_for_equivalent_min_and_max_credits

# 需要导入模块: from courses.tests.factories import CourseFactory [as 别名]
# 或者: from courses.tests.factories.CourseFactory import build [as 别名]
 def test_credits_display_for_equivalent_min_and_max_credits(self):
     course = CourseFactory.build(min_credits=4, max_credits=4)
     self.assertEqual('4 credits', course.credits_display)
开发者ID:Lucky1313,项目名称:YACS,代码行数:5,代码来源:models.py

示例4: test_credits_display_for_equivalent_min_and_max_credits_as_one_credit

# 需要导入模块: from courses.tests.factories import CourseFactory [as 别名]
# 或者: from courses.tests.factories.CourseFactory import build [as 别名]
 def test_credits_display_for_equivalent_min_and_max_credits_as_one_credit(self):
     course = CourseFactory.build(min_credits=1, max_credits=1)
     self.assertEqual('1 credit', course.credits_display)
开发者ID:Lucky1313,项目名称:YACS,代码行数:5,代码来源:models.py

示例5: test_code

# 需要导入模块: from courses.tests.factories import CourseFactory [as 别名]
# 或者: from courses.tests.factories.CourseFactory import build [as 别名]
 def test_code(self):
     dept = DepartmentFactory.build(code='CSCI')
     course = CourseFactory.build(department=dept, number=1100)
     self.assertEqual('CSCI 1100', course.code)
开发者ID:Lucky1313,项目名称:YACS,代码行数:6,代码来源:models.py


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