From 8eaa72e7a388e71bf84e1e61118d3904c30f2ab9 Mon Sep 17 00:00:00 2001 From: Gust Date: Thu, 6 Aug 2015 10:16:20 -0300 Subject: [PATCH] Fix tests --- colab/plugins/gitlab/migrations/0005_auto_20150806_1230.py | 24 ++++++++++++++++++++++++ colab/plugins/gitlab/tests/test_gitlab.py | 16 ++++++++-------- 2 files changed, 32 insertions(+), 8 deletions(-) create mode 100644 colab/plugins/gitlab/migrations/0005_auto_20150806_1230.py diff --git a/colab/plugins/gitlab/migrations/0005_auto_20150806_1230.py b/colab/plugins/gitlab/migrations/0005_auto_20150806_1230.py new file mode 100644 index 0000000..2147b7c --- /dev/null +++ b/colab/plugins/gitlab/migrations/0005_auto_20150806_1230.py @@ -0,0 +1,24 @@ +# -*- coding: utf-8 -*- +from __future__ import unicode_literals + +from django.db import models, migrations + + +class Migration(migrations.Migration): + + dependencies = [ + ('gitlab', '0004_auto_20150630_1149'), + ] + + operations = [ + migrations.RemoveField( + model_name='gitlabcomment', + name='iid', + ), + migrations.AddField( + model_name='gitlabissue', + name='iid', + field=models.IntegerField(null=True), + preserve_default=True, + ), + ] diff --git a/colab/plugins/gitlab/tests/test_gitlab.py b/colab/plugins/gitlab/tests/test_gitlab.py index fc8bb19..188a21d 100644 --- a/colab/plugins/gitlab/tests/test_gitlab.py +++ b/colab/plugins/gitlab/tests/test_gitlab.py @@ -24,9 +24,9 @@ class GitlabTest(TestCase): pass def test_data_integrity(self): - self.assertEqual(GitlabProject.objects.all().count(), 1) - self.assertEqual(GitlabMergeRequest.objects.all().count(), 1) - self.assertEqual(GitlabIssue.objects.all().count(), 1) + self.assertEqual(GitlabProject.objects.all().count(), 2) + self.assertEqual(GitlabMergeRequest.objects.all().count(), 2) + self.assertEqual(GitlabIssue.objects.all().count(), 2) self.assertEqual(GitlabComment.objects.all().count(), 2) def test_project_url(self): @@ -62,9 +62,9 @@ class GitlabTest(TestCase): g1.created_at = datetime.now() g1.last_activity_at = datetime.now() g1.save() - + g2 = GitlabProject() - g2.id = 1 + g2.id = 2 g2.name = "colabinc" g2.name_with_namespace = "Software Public / ColabInc" g2.path_with_namespace = "softwarepublico/colabinc" @@ -107,7 +107,7 @@ class GitlabTest(TestCase): i2 = GitlabIssue() i2.id = 2 - i2.iid = 2 + i2.iid = 1 i2.project = g2 i2.title = "Issue for colab" i2.description = "Issue reported to colab" @@ -115,10 +115,10 @@ class GitlabTest(TestCase): i2.state = "Open" i2.update_user(self.user.username) i2.save() - + c1 = GitlabComment() c1.id = 1 - c1.parent_id = mr.iid + c1.parent_id = mr1.iid c1.project = g1 c1.body = "Comment to merge request" c1.created_at = datetime.now() -- libgit2 0.21.2