def test_set_fork_name(self): """ Set org & repo using the fork name """ watched_pr = WatchedPullRequest() watched_pr.set_fork_name('org2/another-repo') self.assertEqual(watched_pr.github_organization_name, 'org2') self.assertEqual(watched_pr.github_repository_name, 'another-repo') watched_pr.save() # pylint: disable=no-member # Check values in DB watched_pr = WatchedPullRequest.objects.get(pk=watched_pr.pk) self.assertEqual(watched_pr.github_organization_name, 'org2') self.assertEqual(watched_pr.github_repository_name, 'another-repo')
def test_set_fork_name(self): """ Set org & repo using the fork name """ watched_pr = WatchedPullRequest() watched_pr.set_fork_name('org2/another-repo') self.assertEqual(watched_pr.github_organization_name, 'org2') self.assertEqual(watched_pr.github_repository_name, 'another-repo') watched_pr.save() # Check values in DB watched_pr = WatchedPullRequest.objects.get(pk=watched_pr.pk) self.assertEqual(watched_pr.github_organization_name, 'org2') self.assertEqual(watched_pr.github_repository_name, 'another-repo')
def test_set_fork_name(self): """ Set org & repo using the fork name """ _, organization = make_user_and_organization(org_name="Org2", org_handle="org2") watched_fork = WatchedForkFactory(organization=organization, fork='some-name') watched_pr = WatchedPullRequest(watched_fork=watched_fork) watched_pr.set_fork_name('org2/another-repo') self.assertEqual(watched_pr.github_organization_name, 'org2') self.assertEqual(watched_pr.github_repository_name, 'another-repo') watched_pr.save() # Check values in DB watched_pr = WatchedPullRequest.objects.get(pk=watched_pr.pk) self.assertEqual(watched_pr.github_organization_name, 'org2') self.assertEqual(watched_pr.github_repository_name, 'another-repo')