Commit 4dbbc50cbb6fad0efb83634cb8448ef794967c71

Authored by Gust
Committed by Sergio Oliveira
1 parent e460fd68

Fix tests

colab/proxy/gitlab/search_indexes.py
@@ -118,4 +118,3 @@ class GitlabCommentIndex(indexes.SearchIndex, indexes.Indexable): @@ -118,4 +118,3 @@ class GitlabCommentIndex(indexes.SearchIndex, indexes.Indexable):
118 118
119 def prepare_tag(self, obj): 119 def prepare_tag(self, obj):
120 return obj.tag 120 return obj.tag
121 -  
colab/proxy/gitlab/tests/test_gitlab.py
@@ -2,13 +2,14 @@ @@ -2,13 +2,14 @@
2 Test User class. 2 Test User class.
3 Objective: Test parameters, and behavior. 3 Objective: Test parameters, and behavior.
4 """ 4 """
  5 +from datetime import datetime
  6 +
  7 +
5 from django.test import TestCase, Client 8 from django.test import TestCase, Client
6 from colab.accounts.models import User 9 from colab.accounts.models import User
7 from colab.proxy.gitlab.models import GitlabProject, \ 10 from colab.proxy.gitlab.models import GitlabProject, \
8 GitlabIssue, GitlabComment, GitlabMergeRequest 11 GitlabIssue, GitlabComment, GitlabMergeRequest
9 12
10 -from datetime import datetime  
11 -  
12 13
13 class GitlabTest(TestCase): 14 class GitlabTest(TestCase):
14 15
@@ -54,7 +55,6 @@ class GitlabTest(TestCase): @@ -54,7 +55,6 @@ class GitlabTest(TestCase):
54 g.name = "colab" 55 g.name = "colab"
55 g.name_with_namespace = "Software Public / Colab" 56 g.name_with_namespace = "Software Public / Colab"
56 g.path_with_namespace = "softwarepublico/colab" 57 g.path_with_namespace = "softwarepublico/colab"
57 - g.modified = datetime.now()  
58 g.created_at = datetime.now() 58 g.created_at = datetime.now()
59 g.last_activity_at = datetime.now() 59 g.last_activity_at = datetime.now()
60 g.save() 60 g.save()
@@ -65,7 +65,7 @@ class GitlabTest(TestCase): @@ -65,7 +65,7 @@ class GitlabTest(TestCase):
65 mr.title = "Include plugin support" 65 mr.title = "Include plugin support"
66 mr.description = "Merge request for plugin support" 66 mr.description = "Merge request for plugin support"
67 mr.state = "Closed" 67 mr.state = "Closed"
68 - mr.modified = datetime.now() 68 + mr.created_at = datetime.now()
69 mr.update_user(self.user.username) 69 mr.update_user(self.user.username)
70 mr.save() 70 mr.save()
71 71
@@ -74,7 +74,7 @@ class GitlabTest(TestCase): @@ -74,7 +74,7 @@ class GitlabTest(TestCase):
74 i.project = g 74 i.project = g
75 i.title = "Issue for colab" 75 i.title = "Issue for colab"
76 i.description = "Issue reported to colab" 76 i.description = "Issue reported to colab"
77 - i.modified = datetime.now() 77 + i.created_at = datetime.now()
78 i.state = "Open" 78 i.state = "Open"
79 i.update_user(self.user.username) 79 i.update_user(self.user.username)
80 i.save() 80 i.save()