Commit f1e92a83df8aa7da1b0788beabdbcf2f6be266d0
1 parent
c72f8481
Exists in
master
and in
31 other branches
Fixed Gitlab tests
Showing
2 changed files
with
7 additions
and
7 deletions
Show diff stats
colab/plugins/gitlab/models.py
... | ... | @@ -139,7 +139,7 @@ class GitlabComment(Collaboration): |
139 | 139 | url_str = u'/gitlab/{}/merge_requests/{}#notes_{}' |
140 | 140 | |
141 | 141 | return url_str.format(self.project.path_with_namespace, |
142 | - self.parent_id, self.iid) | |
142 | + self.parent_id, self.iid) | |
143 | 143 | |
144 | 144 | class Meta: |
145 | 145 | verbose_name = _('Gitlab Comments') | ... | ... |
colab/plugins/gitlab/tests/test_gitlab.py
... | ... | @@ -34,7 +34,7 @@ class GitlabTest(TestCase): |
34 | 34 | '/gitlab/softwarepublico/colab') |
35 | 35 | |
36 | 36 | def test_merge_request_url(self): |
37 | - self.assertEqual(GitlabMergeRequest.objects.get(id=1).url, | |
37 | + self.assertEqual(GitlabMergeRequest.objects.get(iid=1).url, | |
38 | 38 | '/gitlab/softwarepublico/colab/merge_requests/1') |
39 | 39 | |
40 | 40 | def test_issue_url(self): |
... | ... | @@ -43,7 +43,7 @@ class GitlabTest(TestCase): |
43 | 43 | |
44 | 44 | def test_comment_on_mr_url(self): |
45 | 45 | url = '/gitlab/softwarepublico/colab/merge_requests/1#notes_1' |
46 | - self.assertEqual(GitlabComment.objects.get(id=1).url, url) | |
46 | + self.assertEqual(GitlabComment.objects.get(iid=1).url, url) | |
47 | 47 | |
48 | 48 | def test_comment_on_issue_url(self): |
49 | 49 | self.assertEqual(GitlabComment.objects.get(id=2).url, |
... | ... | @@ -60,7 +60,7 @@ class GitlabTest(TestCase): |
60 | 60 | g.save() |
61 | 61 | |
62 | 62 | mr = GitlabMergeRequest() |
63 | - mr.id = 1 | |
63 | + mr.iid = 1 | |
64 | 64 | mr.project = g |
65 | 65 | mr.title = "Include plugin support" |
66 | 66 | mr.description = "Merge request for plugin support" |
... | ... | @@ -80,8 +80,8 @@ class GitlabTest(TestCase): |
80 | 80 | i.save() |
81 | 81 | |
82 | 82 | c1 = GitlabComment() |
83 | - c1.id = 1 | |
84 | - c1.parent_id = mr.id | |
83 | + c1.iid = 1 | |
84 | + c1.parent_id = mr.iid | |
85 | 85 | c1.project = g |
86 | 86 | c1.body = "Comment to merge request" |
87 | 87 | c1.created_at = datetime.now() |
... | ... | @@ -90,7 +90,7 @@ class GitlabTest(TestCase): |
90 | 90 | c1.save() |
91 | 91 | |
92 | 92 | c2 = GitlabComment() |
93 | - c2.id = 2 | |
93 | + c2.iid = 2 | |
94 | 94 | c2.parent_id = i.id |
95 | 95 | c2.project = g |
96 | 96 | c2.body = "Comment to issue" | ... | ... |