Show More
@@ -25,6 +25,7 b' from rhodecode.tests import *' | |||||
25 | from rhodecode.model.db import ( |
|
25 | from rhodecode.model.db import ( | |
26 | ChangesetComment, Notification, UserNotification) |
|
26 | ChangesetComment, Notification, UserNotification) | |
27 | from rhodecode.model.meta import Session |
|
27 | from rhodecode.model.meta import Session | |
|
28 | from rhodecode.lib import helpers as h | |||
28 |
|
29 | |||
29 |
|
30 | |||
30 | @pytest.mark.backends("git", "hg", "svn") |
|
31 | @pytest.mark.backends("git", "hg", "svn") | |
@@ -53,7 +54,8 b' class TestChangeSetCommentsController(Te' | |||||
53 |
|
54 | |||
54 | def test_create(self, backend): |
|
55 | def test_create(self, backend): | |
55 | self.log_user() |
|
56 | self.log_user() | |
56 |
commit |
|
57 | commit = backend.repo.get_commit('300') | |
|
58 | commit_id = commit.raw_id | |||
57 | text = u'CommentOnCommit' |
|
59 | text = u'CommentOnCommit' | |
58 |
|
60 | |||
59 | params = {'text': text, 'csrf_token': self.csrf_token} |
|
61 | params = {'text': text, 'csrf_token': self.csrf_token} | |
@@ -77,7 +79,8 b' class TestChangeSetCommentsController(Te' | |||||
77 | comment_id = ChangesetComment.query().first().comment_id |
|
79 | comment_id = ChangesetComment.query().first().comment_id | |
78 | assert notification.type_ == Notification.TYPE_CHANGESET_COMMENT |
|
80 | assert notification.type_ == Notification.TYPE_CHANGESET_COMMENT | |
79 |
|
81 | |||
80 |
sbj = 'commented on |
|
82 | sbj = 'commented on commit `{0}` in the {1} repository'.format( | |
|
83 | h.show_id(commit), backend.repo_name) | |||
81 | assert sbj in notification.subject |
|
84 | assert sbj in notification.subject | |
82 |
|
85 | |||
83 | lnk = (u'/{0}/changeset/{1}#comment-{2}'.format( |
|
86 | lnk = (u'/{0}/changeset/{1}#comment-{2}'.format( | |
@@ -86,7 +89,8 b' class TestChangeSetCommentsController(Te' | |||||
86 |
|
89 | |||
87 | def test_create_inline(self, backend): |
|
90 | def test_create_inline(self, backend): | |
88 | self.log_user() |
|
91 | self.log_user() | |
89 |
commit |
|
92 | commit = backend.repo.get_commit('300') | |
|
93 | commit_id = commit.raw_id | |||
90 | text = u'CommentOnCommit' |
|
94 | text = u'CommentOnCommit' | |
91 | f_path = 'vcs/web/simplevcs/views/repository.py' |
|
95 | f_path = 'vcs/web/simplevcs/views/repository.py' | |
92 | line = 'n1' |
|
96 | line = 'n1' | |
@@ -119,8 +123,10 b' class TestChangeSetCommentsController(Te' | |||||
119 | assert notification.type_ == Notification.TYPE_CHANGESET_COMMENT |
|
123 | assert notification.type_ == Notification.TYPE_CHANGESET_COMMENT | |
120 |
|
124 | |||
121 | assert comment.revision == commit_id |
|
125 | assert comment.revision == commit_id | |
122 |
|
126 | sbj = 'commented on commit `{commit}` ' \ | ||
123 | sbj = ' commented on a commit of {0}'.format(backend.repo_name) |
|
127 | '(file: `{f_path}`) in the {repo} repository'.format( | |
|
128 | commit=h.show_id(commit), | |||
|
129 | f_path=f_path, line=line, repo=backend.repo_name) | |||
124 | assert sbj in notification.subject |
|
130 | assert sbj in notification.subject | |
125 |
|
131 | |||
126 | lnk = (u'/{0}/changeset/{1}#comment-{2}'.format( |
|
132 | lnk = (u'/{0}/changeset/{1}#comment-{2}'.format( |
General Comments 0
You need to be logged in to leave comments.
Login now