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')
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')