Commit 8eaa72e7a388e71bf84e1e61118d3904c30f2ab9
Committed by
Lucas Kanashiro
1 parent
b8a689de
Exists in
master
and in
28 other branches
Fix tests
Showing
2 changed files
with
32 additions
and
8 deletions
Show diff stats
colab/plugins/gitlab/migrations/0005_auto_20150806_1230.py
0 → 100644
... | ... | @@ -0,0 +1,24 @@ |
1 | +# -*- coding: utf-8 -*- | |
2 | +from __future__ import unicode_literals | |
3 | + | |
4 | +from django.db import models, migrations | |
5 | + | |
6 | + | |
7 | +class Migration(migrations.Migration): | |
8 | + | |
9 | + dependencies = [ | |
10 | + ('gitlab', '0004_auto_20150630_1149'), | |
11 | + ] | |
12 | + | |
13 | + operations = [ | |
14 | + migrations.RemoveField( | |
15 | + model_name='gitlabcomment', | |
16 | + name='iid', | |
17 | + ), | |
18 | + migrations.AddField( | |
19 | + model_name='gitlabissue', | |
20 | + name='iid', | |
21 | + field=models.IntegerField(null=True), | |
22 | + preserve_default=True, | |
23 | + ), | |
24 | + ] | ... | ... |
colab/plugins/gitlab/tests/test_gitlab.py
... | ... | @@ -24,9 +24,9 @@ class GitlabTest(TestCase): |
24 | 24 | pass |
25 | 25 | |
26 | 26 | def test_data_integrity(self): |
27 | - self.assertEqual(GitlabProject.objects.all().count(), 1) | |
28 | - self.assertEqual(GitlabMergeRequest.objects.all().count(), 1) | |
29 | - self.assertEqual(GitlabIssue.objects.all().count(), 1) | |
27 | + self.assertEqual(GitlabProject.objects.all().count(), 2) | |
28 | + self.assertEqual(GitlabMergeRequest.objects.all().count(), 2) | |
29 | + self.assertEqual(GitlabIssue.objects.all().count(), 2) | |
30 | 30 | self.assertEqual(GitlabComment.objects.all().count(), 2) |
31 | 31 | |
32 | 32 | def test_project_url(self): |
... | ... | @@ -62,9 +62,9 @@ class GitlabTest(TestCase): |
62 | 62 | g1.created_at = datetime.now() |
63 | 63 | g1.last_activity_at = datetime.now() |
64 | 64 | g1.save() |
65 | - | |
65 | + | |
66 | 66 | g2 = GitlabProject() |
67 | - g2.id = 1 | |
67 | + g2.id = 2 | |
68 | 68 | g2.name = "colabinc" |
69 | 69 | g2.name_with_namespace = "Software Public / ColabInc" |
70 | 70 | g2.path_with_namespace = "softwarepublico/colabinc" |
... | ... | @@ -107,7 +107,7 @@ class GitlabTest(TestCase): |
107 | 107 | |
108 | 108 | i2 = GitlabIssue() |
109 | 109 | i2.id = 2 |
110 | - i2.iid = 2 | |
110 | + i2.iid = 1 | |
111 | 111 | i2.project = g2 |
112 | 112 | i2.title = "Issue for colab" |
113 | 113 | i2.description = "Issue reported to colab" |
... | ... | @@ -115,10 +115,10 @@ class GitlabTest(TestCase): |
115 | 115 | i2.state = "Open" |
116 | 116 | i2.update_user(self.user.username) |
117 | 117 | i2.save() |
118 | - | |
118 | + | |
119 | 119 | c1 = GitlabComment() |
120 | 120 | c1.id = 1 |
121 | - c1.parent_id = mr.iid | |
121 | + c1.parent_id = mr1.iid | |
122 | 122 | c1.project = g1 |
123 | 123 | c1.body = "Comment to merge request" |
124 | 124 | c1.created_at = datetime.now() | ... | ... |