Show More
@@ -20,7 +20,7 b'' | |||
|
20 | 20 | |
|
21 | 21 | import pytest |
|
22 | 22 | |
|
23 |
from rhodecode.model.comment import |
|
|
23 | from rhodecode.model.comment import CommentsModel | |
|
24 | 24 | from rhodecode.model.db import UserLog |
|
25 | 25 | from rhodecode.model.pull_request import PullRequestModel |
|
26 | 26 | from rhodecode.tests import TEST_USER_ADMIN_LOGIN |
@@ -52,7 +52,7 b' class TestCommentPullRequest(object):' | |||
|
52 | 52 | response = api_call(self.app, params) |
|
53 | 53 | pull_request = PullRequestModel().get(pull_request.pull_request_id) |
|
54 | 54 | |
|
55 |
comments = |
|
|
55 | comments = CommentsModel().get_comments( | |
|
56 | 56 | pull_request.target_repo.repo_id, pull_request=pull_request) |
|
57 | 57 | |
|
58 | 58 | expected = { |
@@ -83,7 +83,7 b' class TestCommentPullRequest(object):' | |||
|
83 | 83 | response = api_call(self.app, params) |
|
84 | 84 | pull_request = PullRequestModel().get(pull_request_id) |
|
85 | 85 | |
|
86 |
comments = |
|
|
86 | comments = CommentsModel().get_comments( | |
|
87 | 87 | pull_request.target_repo.repo_id, pull_request=pull_request) |
|
88 | 88 | expected = { |
|
89 | 89 | 'pull_request_id': pull_request.pull_request_id, |
@@ -132,7 +132,7 b' class TestCommentPullRequest(object):' | |||
|
132 | 132 | response = api_call(self.app, params) |
|
133 | 133 | pull_request = PullRequestModel().get(pull_request_id) |
|
134 | 134 | |
|
135 |
comments = |
|
|
135 | comments = CommentsModel().get_comments( | |
|
136 | 136 | pull_request.target_repo.repo_id, pull_request=pull_request) |
|
137 | 137 | expected = { |
|
138 | 138 | 'pull_request_id': pull_request.pull_request_id, |
@@ -30,7 +30,7 b' from rhodecode.lib.auth import (HasRepoP' | |||
|
30 | 30 | from rhodecode.lib.base import vcs_operation_context |
|
31 | 31 | from rhodecode.lib.utils2 import str2bool |
|
32 | 32 | from rhodecode.model.changeset_status import ChangesetStatusModel |
|
33 |
from rhodecode.model.comment import |
|
|
33 | from rhodecode.model.comment import CommentsModel | |
|
34 | 34 | from rhodecode.model.db import Session, ChangesetStatus |
|
35 | 35 | from rhodecode.model.pull_request import PullRequestModel |
|
36 | 36 | from rhodecode.model.settings import SettingsModel |
@@ -455,7 +455,7 b' def comment_pull_request(request, apiuse' | |||
|
455 | 455 | renderer = rc_config.get('rhodecode_markup_renderer', 'rst') |
|
456 | 456 | |
|
457 | 457 | status_change = status and allowed_to_change_status |
|
458 |
comment = |
|
|
458 | comment = CommentsModel().create( | |
|
459 | 459 | text=text, |
|
460 | 460 | repo=pull_request.target_repo.repo_id, |
|
461 | 461 | user=apiuser.user_id, |
@@ -34,7 +34,7 b' from rhodecode.lib.exceptions import Sta' | |||
|
34 | 34 | from rhodecode.lib.utils2 import str2bool, time_to_datetime |
|
35 | 35 | from rhodecode.lib.ext_json import json |
|
36 | 36 | from rhodecode.model.changeset_status import ChangesetStatusModel |
|
37 |
from rhodecode.model.comment import |
|
|
37 | from rhodecode.model.comment import CommentsModel | |
|
38 | 38 | from rhodecode.model.db import ( |
|
39 | 39 | Session, ChangesetStatus, RepositoryField, Repository, RepoGroup) |
|
40 | 40 | from rhodecode.model.repo import RepoModel |
@@ -1436,7 +1436,7 b' def comment_commit(' | |||
|
1436 | 1436 | rc_config = SettingsModel().get_all_settings() |
|
1437 | 1437 | renderer = rc_config.get('rhodecode_markup_renderer', 'rst') |
|
1438 | 1438 | status_change_label = ChangesetStatus.get_status_lbl(status) |
|
1439 |
comm = |
|
|
1439 | comm = CommentsModel().create( | |
|
1440 | 1440 | message, repo, user, commit_id=commit_id, |
|
1441 | 1441 | status_change=status_change_label, |
|
1442 | 1442 | status_change_type=status, |
@@ -57,7 +57,7 b' from rhodecode.model.repo import RepoMod' | |||
|
57 | 57 | from rhodecode.model.auth_token import AuthTokenModel |
|
58 | 58 | from rhodecode.model.meta import Session |
|
59 | 59 | from rhodecode.model.pull_request import PullRequestModel |
|
60 |
from rhodecode.model.comment import |
|
|
60 | from rhodecode.model.comment import CommentsModel | |
|
61 | 61 | |
|
62 | 62 | log = logging.getLogger(__name__) |
|
63 | 63 | |
@@ -322,7 +322,7 b' class MyAccountController(BaseController' | |||
|
322 | 322 | data = [] |
|
323 | 323 | for pr in pull_requests: |
|
324 | 324 | repo_id = pr.target_repo_id |
|
325 |
comments = |
|
|
325 | comments = CommentsModel().get_all_comments( | |
|
326 | 326 | repo_id, pull_request=pr) |
|
327 | 327 | owned = pr.user_id == c.rhodecode_user.user_id |
|
328 | 328 | status = pr.calculated_review_status() |
@@ -46,7 +46,7 b' from rhodecode.lib.vcs.exceptions import' | |||
|
46 | 46 | RepositoryError, CommitDoesNotExistError, NodeDoesNotExistError) |
|
47 | 47 | from rhodecode.model.db import ChangesetComment, ChangesetStatus |
|
48 | 48 | from rhodecode.model.changeset_status import ChangesetStatusModel |
|
49 |
from rhodecode.model.comment import |
|
|
49 | from rhodecode.model.comment import CommentsModel | |
|
50 | 50 | from rhodecode.model.meta import Session |
|
51 | 51 | from rhodecode.model.repo import RepoModel |
|
52 | 52 | |
@@ -210,7 +210,7 b' class ChangesetController(BaseRepoContro' | |||
|
210 | 210 | c.comments = [] |
|
211 | 211 | if len(c.commit_ranges) == 1: |
|
212 | 212 | commit = c.commit_ranges[0] |
|
213 |
c.comments = |
|
|
213 | c.comments = CommentsModel().get_comments( | |
|
214 | 214 | c.rhodecode_db_repo.repo_id, |
|
215 | 215 | revision=commit.raw_id) |
|
216 | 216 | c.statuses.append(ChangesetStatusModel().get_status( |
@@ -255,9 +255,9 b' class ChangesetController(BaseRepoContro' | |||
|
255 | 255 | return None |
|
256 | 256 | return get_node |
|
257 | 257 | |
|
258 |
inline_comments = |
|
|
258 | inline_comments = CommentsModel().get_inline_comments( | |
|
259 | 259 | c.rhodecode_db_repo.repo_id, revision=commit.raw_id) |
|
260 |
c.inline_cnt = |
|
|
260 | c.inline_cnt = CommentsModel().get_inline_comments_count( | |
|
261 | 261 | inline_comments) |
|
262 | 262 | |
|
263 | 263 | diffset = codeblocks.DiffSet( |
@@ -346,7 +346,7 b' class ChangesetController(BaseRepoContro' | |||
|
346 | 346 | commit_ids = multi_commit_ids or [commit_id] |
|
347 | 347 | comment = None |
|
348 | 348 | for current_id in filter(None, commit_ids): |
|
349 |
c.co = comment = |
|
|
349 | c.co = comment = CommentsModel().create( | |
|
350 | 350 | text=text, |
|
351 | 351 | repo=c.rhodecode_db_repo.repo_id, |
|
352 | 352 | user=c.rhodecode_user.user_id, |
@@ -426,7 +426,7 b' class ChangesetController(BaseRepoContro' | |||
|
426 | 426 | owner = (comment.author.user_id == c.rhodecode_user.user_id) |
|
427 | 427 | is_repo_admin = h.HasRepoPermissionAny('repository.admin')(c.repo_name) |
|
428 | 428 | if h.HasPermissionAny('hg.admin')() or is_repo_admin or owner: |
|
429 |
|
|
|
429 | CommentsModel().delete(comment=comment) | |
|
430 | 430 | Session().commit() |
|
431 | 431 | return True |
|
432 | 432 | else: |
@@ -55,7 +55,7 b' from rhodecode.lib.vcs.exceptions import' | |||
|
55 | 55 | NodeDoesNotExistError) |
|
56 | 56 | |
|
57 | 57 | from rhodecode.model.changeset_status import ChangesetStatusModel |
|
58 |
from rhodecode.model.comment import |
|
|
58 | from rhodecode.model.comment import CommentsModel | |
|
59 | 59 | from rhodecode.model.db import (PullRequest, ChangesetStatus, ChangesetComment, |
|
60 | 60 | Repository, PullRequestVersion) |
|
61 | 61 | from rhodecode.model.forms import PullRequestForm |
@@ -258,7 +258,7 b' class PullrequestsController(BaseRepoCon' | |||
|
258 | 258 | _render = PartialRenderer('data_table/_dt_elements.mako') |
|
259 | 259 | data = [] |
|
260 | 260 | for pr in pull_requests: |
|
261 |
comments = |
|
|
261 | comments = CommentsModel().get_all_comments( | |
|
262 | 262 | c.rhodecode_db_repo.repo_id, pull_request=pr) |
|
263 | 263 | |
|
264 | 264 | data.append({ |
@@ -796,7 +796,7 b' class PullrequestsController(BaseRepoCon' | |||
|
796 | 796 | pull_request_latest, c.rhodecode_user) and not pr_closed |
|
797 | 797 | c.allowed_to_comment = not pr_closed |
|
798 | 798 | |
|
799 |
cc_model = |
|
|
799 | cc_model = CommentsModel() | |
|
800 | 800 | |
|
801 | 801 | c.pull_request_reviewers = pull_request_at_ver.reviewers_statuses() |
|
802 | 802 | c.pull_request_review_status = pull_request_at_ver.calculated_review_status() |
@@ -837,7 +837,7 b' class PullrequestsController(BaseRepoCon' | |||
|
837 | 837 | |
|
838 | 838 | # outdated comments |
|
839 | 839 | c.outdated_cnt = 0 |
|
840 |
if |
|
|
840 | if CommentsModel.use_outdated_comments(pull_request_latest): | |
|
841 | 841 | outdated_comments = cc_model.get_outdated_comments( |
|
842 | 842 | c.rhodecode_db_repo.repo_id, |
|
843 | 843 | pull_request=pull_request_at_ver) |
@@ -923,7 +923,7 b' class PullrequestsController(BaseRepoCon' | |||
|
923 | 923 | if close_pr: |
|
924 | 924 | message = _('Closing with') + ' ' + message |
|
925 | 925 | text = text or message |
|
926 |
comm = |
|
|
926 | comm = CommentsModel().create( | |
|
927 | 927 | text=text, |
|
928 | 928 | repo=c.rhodecode_db_repo.repo_id, |
|
929 | 929 | user=c.rhodecode_user.user_id, |
@@ -1013,7 +1013,7 b' class PullrequestsController(BaseRepoCon' | |||
|
1013 | 1013 | is_repo_admin = h.HasRepoPermissionAny('repository.admin')(c.repo_name) |
|
1014 | 1014 | if h.HasPermissionAny('hg.admin')() or is_repo_admin or is_owner: |
|
1015 | 1015 | old_calculated_status = co.pull_request.calculated_review_status() |
|
1016 |
|
|
|
1016 | CommentsModel().delete(comment=co) | |
|
1017 | 1017 | Session().commit() |
|
1018 | 1018 | calculated_status = co.pull_request.calculated_review_status() |
|
1019 | 1019 | if old_calculated_status != calculated_status: |
@@ -114,7 +114,7 b' class PullRequestCommentEvent(PullReques' | |||
|
114 | 114 | self.comment = comment |
|
115 | 115 | |
|
116 | 116 | def as_dict(self): |
|
117 |
from rhodecode.model.comment import |
|
|
117 | from rhodecode.model.comment import CommentsModel | |
|
118 | 118 | data = super(PullRequestCommentEvent, self).as_dict() |
|
119 | 119 | |
|
120 | 120 | status = None |
@@ -125,7 +125,7 b' class PullRequestCommentEvent(PullReques' | |||
|
125 | 125 | 'comment': { |
|
126 | 126 | 'status': status, |
|
127 | 127 | 'text': self.comment.text, |
|
128 |
'url': |
|
|
128 | 'url': CommentsModel().get_url(self.comment) | |
|
129 | 129 | } |
|
130 | 130 | }) |
|
131 | 131 | return data |
@@ -201,8 +201,8 b' class ChangesetStatusModel(BaseModel):' | |||
|
201 | 201 | return new_status |
|
202 | 202 | |
|
203 | 203 | if not comment: |
|
204 |
from rhodecode.model.comment import |
|
|
205 |
comment = |
|
|
204 | from rhodecode.model.comment import CommentsModel | |
|
205 | comment = CommentsModel().create( | |
|
206 | 206 | text=self._render_auto_status_message( |
|
207 | 207 | status, commit_id=revision, pull_request=pull_request), |
|
208 | 208 | repo=repo, |
@@ -48,7 +48,7 b' from rhodecode.model.notification import' | |||
|
48 | 48 | log = logging.getLogger(__name__) |
|
49 | 49 | |
|
50 | 50 | |
|
51 |
class |
|
|
51 | class CommentsModel(BaseModel): | |
|
52 | 52 | |
|
53 | 53 | cls = ChangesetComment |
|
54 | 54 | |
@@ -392,7 +392,7 b' class ChangesetCommentsModel(BaseModel):' | |||
|
392 | 392 | |
|
393 | 393 | elif pull_request: |
|
394 | 394 | pull_request = self.__get_pull_request(pull_request) |
|
395 |
if not |
|
|
395 | if not CommentsModel.use_outdated_comments(pull_request): | |
|
396 | 396 | q = self._visible_inline_comments_of_pull_request(pull_request) |
|
397 | 397 | else: |
|
398 | 398 | q = self._all_inline_comments_of_pull_request(pull_request) |
@@ -414,7 +414,7 b' class ChangesetCommentsModel(BaseModel):' | |||
|
414 | 414 | return max(cls.DIFF_CONTEXT_BEFORE, cls.DIFF_CONTEXT_AFTER) |
|
415 | 415 | |
|
416 | 416 | def outdate_comments(self, pull_request, old_diff_data, new_diff_data): |
|
417 |
if not |
|
|
417 | if not CommentsModel.use_outdated_comments(pull_request): | |
|
418 | 418 | return |
|
419 | 419 | |
|
420 | 420 | comments = self._visible_inline_comments_of_pull_request(pull_request) |
@@ -47,7 +47,7 b' from rhodecode.lib.vcs.exceptions import' | |||
|
47 | 47 | CommitDoesNotExistError, EmptyRepositoryError) |
|
48 | 48 | from rhodecode.model import BaseModel |
|
49 | 49 | from rhodecode.model.changeset_status import ChangesetStatusModel |
|
50 |
from rhodecode.model.comment import |
|
|
50 | from rhodecode.model.comment import CommentsModel | |
|
51 | 51 | from rhodecode.model.db import ( |
|
52 | 52 | PullRequest, PullRequestReviewers, ChangesetStatus, |
|
53 | 53 | PullRequestVersion, ChangesetComment) |
@@ -552,7 +552,7 b' class PullRequestModel(BaseModel):' | |||
|
552 | 552 | pull_request.merge_rev = merge_state.merge_ref.commit_id |
|
553 | 553 | pull_request.updated_on = datetime.datetime.now() |
|
554 | 554 | |
|
555 |
|
|
|
555 | CommentsModel().create( | |
|
556 | 556 | text=unicode(_('Pull request merged and closed')), |
|
557 | 557 | repo=pull_request.target_repo.repo_id, |
|
558 | 558 | user=user.user_id, |
@@ -655,7 +655,7 b' class PullRequestModel(BaseModel):' | |||
|
655 | 655 | old_diff_data, new_diff_data = self._generate_update_diffs( |
|
656 | 656 | pull_request, pull_request_version) |
|
657 | 657 | |
|
658 |
|
|
|
658 | CommentsModel().outdate_comments( | |
|
659 | 659 | pull_request, old_diff_data=old_diff_data, |
|
660 | 660 | new_diff_data=new_diff_data) |
|
661 | 661 | |
@@ -663,7 +663,7 b' class PullRequestModel(BaseModel):' | |||
|
663 | 663 | old_diff_data, new_diff_data) |
|
664 | 664 | |
|
665 | 665 | # Add an automatic comment to the pull request |
|
666 |
update_comment = |
|
|
666 | update_comment = CommentsModel().create( | |
|
667 | 667 | text=self._render_update_message(changes, file_changes), |
|
668 | 668 | repo=pull_request.target_repo, |
|
669 | 669 | user=pull_request.author, |
@@ -730,7 +730,7 b' class PullRequestModel(BaseModel):' | |||
|
730 | 730 | def _generate_update_diffs(self, pull_request, pull_request_version): |
|
731 | 731 | diff_context = ( |
|
732 | 732 | self.DIFF_CONTEXT + |
|
733 |
|
|
|
733 | CommentsModel.needed_extra_diff_context()) | |
|
734 | 734 | old_diff = self._get_diff_from_pr_or_version( |
|
735 | 735 | pull_request_version, context=diff_context) |
|
736 | 736 | new_diff = self._get_diff_from_pr_or_version( |
@@ -1001,7 +1001,7 b' class PullRequestModel(BaseModel):' | |||
|
1001 | 1001 | |
|
1002 | 1002 | internal_message = _('Closing with') + ' ' + message |
|
1003 | 1003 | |
|
1004 |
comm = |
|
|
1004 | comm = CommentsModel().create( | |
|
1005 | 1005 | text=internal_message, |
|
1006 | 1006 | repo=repo.repo_id, |
|
1007 | 1007 | user=user.user_id, |
@@ -22,7 +22,7 b' import pytest' | |||
|
22 | 22 | |
|
23 | 23 | from rhodecode.tests.events.conftest import EventCatcher |
|
24 | 24 | |
|
25 |
from rhodecode.model.comment import |
|
|
25 | from rhodecode.model.comment import CommentsModel | |
|
26 | 26 | from rhodecode.model.pull_request import PullRequestModel |
|
27 | 27 | from rhodecode.events import ( |
|
28 | 28 | PullRequestCreateEvent, |
@@ -61,7 +61,7 b' def test_create_pull_request_events(pr_u' | |||
|
61 | 61 | @pytest.mark.backends("git", "hg") |
|
62 | 62 | def test_pullrequest_comment_events_serialized(pr_util): |
|
63 | 63 | pr = pr_util.create_pull_request() |
|
64 |
comment = |
|
|
64 | comment = CommentsModel().get_comments( | |
|
65 | 65 | pr.target_repo.repo_id, pull_request=pr)[0] |
|
66 | 66 | event = PullRequestCommentEvent(pr, comment) |
|
67 | 67 | data = event.as_dict() |
@@ -72,7 +72,7 b' def test_diff_to_comment_line_number(old' | |||
|
72 | 72 | (DiffLineNumber(old=12, new=None), DiffLineNumber(old=21, new=None)), |
|
73 | 73 | ]) |
|
74 | 74 | def test_choose_closest_diff_line_normal(diff_line, expected): |
|
75 |
comment_model = comment. |
|
|
75 | comment_model = comment.CommentsModel() | |
|
76 | 76 | candidates = [ |
|
77 | 77 | DiffLineNumber(old=2, new=None), |
|
78 | 78 | DiffLineNumber(old=21, new=None), |
@@ -82,7 +82,7 b' def test_choose_closest_diff_line_normal' | |||
|
82 | 82 | |
|
83 | 83 | |
|
84 | 84 | def test_revision_comments_are_sorted(): |
|
85 |
comment_model = comment. |
|
|
85 | comment_model = comment.CommentsModel() | |
|
86 | 86 | query = comment_model._get_inline_comments_query( |
|
87 | 87 | repo_id='fake_repo_name', |
|
88 | 88 | revision='fake_revision', |
@@ -92,15 +92,15 b' def test_revision_comments_are_sorted():' | |||
|
92 | 92 | |
|
93 | 93 | @pytest.mark.parametrize('use_outdated', [True, False]) |
|
94 | 94 | def test_pull_request_comments_are_sorted(use_outdated): |
|
95 |
comment_model = comment. |
|
|
95 | comment_model = comment.CommentsModel() | |
|
96 | 96 | pull_request = mock.Mock() |
|
97 | 97 | # TODO: johbo: Had to do this since we have an inline call to |
|
98 | 98 | # self.__get_pull_request. Should be moved out at some point. |
|
99 | 99 | get_instance_patcher = mock.patch.object( |
|
100 |
comment. |
|
|
100 | comment.CommentsModel, '_get_instance', | |
|
101 | 101 | return_value=pull_request) |
|
102 | 102 | config_patcher = mock.patch.object( |
|
103 |
comment. |
|
|
103 | comment.CommentsModel, 'use_outdated_comments', | |
|
104 | 104 | return_value=use_outdated) |
|
105 | 105 | |
|
106 | 106 | with get_instance_patcher, config_patcher as config_mock: |
@@ -123,7 +123,7 b' def assert_inline_comments_order(query):' | |||
|
123 | 123 | |
|
124 | 124 | |
|
125 | 125 | def test_get_renderer(): |
|
126 |
model = comment. |
|
|
126 | model = comment.CommentsModel() | |
|
127 | 127 | renderer = model._get_renderer() |
|
128 | 128 | assert renderer == "rst" |
|
129 | 129 | |
@@ -137,7 +137,7 b' class TestUseOutdatedComments(object):' | |||
|
137 | 137 | 'rhodecode_use_outdated_comments': use_outdated |
|
138 | 138 | } |
|
139 | 139 | with self._patch_settings(general_settings) as settings_mock: |
|
140 |
result = comment. |
|
|
140 | result = comment.CommentsModel.use_outdated_comments( | |
|
141 | 141 | pull_request) |
|
142 | 142 | settings_mock.assert_called_once_with(repo=pull_request.target_repo) |
|
143 | 143 | assert result == use_outdated |
@@ -147,7 +147,7 b' class TestUseOutdatedComments(object):' | |||
|
147 | 147 | |
|
148 | 148 | general_settings = {} |
|
149 | 149 | with self._patch_settings(general_settings) as settings_mock: |
|
150 |
result = comment. |
|
|
150 | result = comment.CommentsModel.use_outdated_comments( | |
|
151 | 151 | pull_request) |
|
152 | 152 | settings_mock.assert_called_once_with(repo=pull_request.target_repo) |
|
153 | 153 | assert result is False |
@@ -29,7 +29,7 b' from rhodecode.lib.vcs.backends.base imp' | |||
|
29 | 29 | MergeResponse, MergeFailureReason, Reference) |
|
30 | 30 | from rhodecode.lib.vcs.exceptions import RepositoryError |
|
31 | 31 | from rhodecode.lib.vcs.nodes import FileNode |
|
32 |
from rhodecode.model.comment import |
|
|
32 | from rhodecode.model.comment import CommentsModel | |
|
33 | 33 | from rhodecode.model.db import PullRequest, Session |
|
34 | 34 | from rhodecode.model.pull_request import PullRequestModel |
|
35 | 35 | from rhodecode.model.user import UserModel |
@@ -811,13 +811,13 b' def test_calculate_commits():' | |||
|
811 | 811 | |
|
812 | 812 | def assert_inline_comments(pull_request, visible=None, outdated=None): |
|
813 | 813 | if visible is not None: |
|
814 |
inline_comments = |
|
|
814 | inline_comments = CommentsModel().get_inline_comments( | |
|
815 | 815 | pull_request.target_repo.repo_id, pull_request=pull_request) |
|
816 |
inline_cnt = |
|
|
816 | inline_cnt = CommentsModel().get_inline_comments_count( | |
|
817 | 817 | inline_comments) |
|
818 | 818 | assert inline_cnt == visible |
|
819 | 819 | if outdated is not None: |
|
820 |
outdated_comments = |
|
|
820 | outdated_comments = CommentsModel().get_outdated_comments( | |
|
821 | 821 | pull_request.target_repo.repo_id, pull_request) |
|
822 | 822 | assert len(outdated_comments) == outdated |
|
823 | 823 | |
@@ -842,5 +842,5 b' def assert_pr_file_changes(' | |||
|
842 | 842 | |
|
843 | 843 | def outdated_comments_patcher(use_outdated=True): |
|
844 | 844 | return mock.patch.object( |
|
845 |
|
|
|
845 | CommentsModel, 'use_outdated_comments', | |
|
846 | 846 | return_value=use_outdated) |
@@ -39,7 +39,7 b' import requests' | |||
|
39 | 39 | import rhodecode |
|
40 | 40 | from rhodecode.lib.utils2 import AttributeDict |
|
41 | 41 | from rhodecode.model.changeset_status import ChangesetStatusModel |
|
42 |
from rhodecode.model.comment import |
|
|
42 | from rhodecode.model.comment import CommentsModel | |
|
43 | 43 | from rhodecode.model.db import ( |
|
44 | 44 | PullRequest, Repository, RhodeCodeSetting, ChangesetStatus, RepoGroup, |
|
45 | 45 | UserGroup, RepoRhodeCodeUi, RepoRhodeCodeSetting, RhodeCodeUi) |
@@ -1038,7 +1038,7 b' class PRTestUtility(object):' | |||
|
1038 | 1038 | return removed_commit_id |
|
1039 | 1039 | |
|
1040 | 1040 | def create_comment(self, linked_to=None): |
|
1041 |
comment = |
|
|
1041 | comment = CommentsModel().create( | |
|
1042 | 1042 | text=u"Test comment", |
|
1043 | 1043 | repo=self.target_repository.repo_name, |
|
1044 | 1044 | user=self.author, |
@@ -1052,7 +1052,7 b' class PRTestUtility(object):' | |||
|
1052 | 1052 | |
|
1053 | 1053 | def create_inline_comment( |
|
1054 | 1054 | self, linked_to=None, line_no=u'n1', file_path='file_1'): |
|
1055 |
comment = |
|
|
1055 | comment = CommentsModel().create( | |
|
1056 | 1056 | text=u"Test comment", |
|
1057 | 1057 | repo=self.target_repository.repo_name, |
|
1058 | 1058 | user=self.author, |
General Comments 0
You need to be logged in to leave comments.
Login now