本文整理汇总了Python中instance.tests.models.factories.instance.OpenEdXInstanceFactory.set_fork_name方法的典型用法代码示例。如果您正苦于以下问题:Python OpenEdXInstanceFactory.set_fork_name方法的具体用法?Python OpenEdXInstanceFactory.set_fork_name怎么用?Python OpenEdXInstanceFactory.set_fork_name使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类instance.tests.models.factories.instance.OpenEdXInstanceFactory
的用法示例。
在下文中一共展示了OpenEdXInstanceFactory.set_fork_name方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_set_fork_name_commit
# 需要导入模块: from instance.tests.models.factories.instance import OpenEdXInstanceFactory [as 别名]
# 或者: from instance.tests.models.factories.instance.OpenEdXInstanceFactory import set_fork_name [as 别名]
def test_set_fork_name_commit(self):
"""
Set org & repo using the fork name - Using the default commit policy (True)
"""
instance = OpenEdXInstanceFactory()
instance.set_fork_name('org2/another-repo')
self.assertEqual(instance.github_organization_name, 'org2')
self.assertEqual(instance.github_repository_name, 'another-repo')
# Check values in DB
db_instance = OpenEdXInstance.objects.get(pk=instance.pk)
self.assertEqual(db_instance.github_organization_name, 'org2')
self.assertEqual(db_instance.github_repository_name, 'another-repo')
示例2: test_set_fork_name_no_commit
# 需要导入模块: from instance.tests.models.factories.instance import OpenEdXInstanceFactory [as 别名]
# 或者: from instance.tests.models.factories.instance.OpenEdXInstanceFactory import set_fork_name [as 别名]
def test_set_fork_name_no_commit(self):
"""
Set org & repo using the fork name, with commit=False
"""
instance = OpenEdXInstanceFactory(
github_organization_name='open-craft',
github_repository_name='edx',
)
instance.set_fork_name('org2/another-repo', commit=False)
self.assertEqual(instance.github_organization_name, 'org2')
self.assertEqual(instance.github_repository_name, 'another-repo')
# Check values in DB
db_instance = OpenEdXInstance.objects.get(pk=instance.pk)
self.assertEqual(db_instance.github_organization_name, 'open-craft')
self.assertEqual(db_instance.github_repository_name, 'edx')