##// END OF EJS Templates
tests: Use merge reference object instead of raw commit id.
Martin Bornhold -
r1058:c3c86c38 default
parent child Browse files
Show More
@@ -25,7 +25,8 b' import textwrap'
25 import rhodecode
25 import rhodecode
26 from rhodecode.lib.utils2 import safe_unicode
26 from rhodecode.lib.utils2 import safe_unicode
27 from rhodecode.lib.vcs.backends import get_backend
27 from rhodecode.lib.vcs.backends import get_backend
28 from rhodecode.lib.vcs.backends.base import MergeResponse, MergeFailureReason
28 from rhodecode.lib.vcs.backends.base import (
29 MergeResponse, MergeFailureReason, Reference)
29 from rhodecode.lib.vcs.exceptions import RepositoryError
30 from rhodecode.lib.vcs.exceptions import RepositoryError
30 from rhodecode.lib.vcs.nodes import FileNode
31 from rhodecode.lib.vcs.nodes import FileNode
31 from rhodecode.model.comment import ChangesetCommentsModel
32 from rhodecode.model.comment import ChangesetCommentsModel
@@ -269,10 +270,10 b' class TestPullRequestModel:'
269
270
270 def test_merge(self, pull_request, merge_extras):
271 def test_merge(self, pull_request, merge_extras):
271 user = UserModel().get_by_username(TEST_USER_ADMIN_LOGIN)
272 user = UserModel().get_by_username(TEST_USER_ADMIN_LOGIN)
273 merge_ref = Reference(
274 'type', 'name', '6126b7bfcc82ad2d3deaee22af926b082ce54cc6')
272 self.merge_mock.return_value = MergeResponse(
275 self.merge_mock.return_value = MergeResponse(
273 True, True,
276 True, True, merge_ref, MergeFailureReason.NONE)
274 '6126b7bfcc82ad2d3deaee22af926b082ce54cc6',
275 MergeFailureReason.NONE)
276
277
277 merge_extras['repository'] = pull_request.target_repo.repo_name
278 merge_extras['repository'] = pull_request.target_repo.repo_name
278 PullRequestModel().merge(
279 PullRequestModel().merge(
@@ -308,10 +309,10 b' class TestPullRequestModel:'
308
309
309 def test_merge_failed(self, pull_request, merge_extras):
310 def test_merge_failed(self, pull_request, merge_extras):
310 user = UserModel().get_by_username(TEST_USER_ADMIN_LOGIN)
311 user = UserModel().get_by_username(TEST_USER_ADMIN_LOGIN)
312 merge_ref = Reference(
313 'type', 'name', '6126b7bfcc82ad2d3deaee22af926b082ce54cc6')
311 self.merge_mock.return_value = MergeResponse(
314 self.merge_mock.return_value = MergeResponse(
312 False, False,
315 False, False, merge_ref, MergeFailureReason.MERGE_FAILED)
313 '6126b7bfcc82ad2d3deaee22af926b082ce54cc6',
314 MergeFailureReason.MERGE_FAILED)
315
316
316 merge_extras['repository'] = pull_request.target_repo.repo_name
317 merge_extras['repository'] = pull_request.target_repo.repo_name
317 PullRequestModel().merge(
318 PullRequestModel().merge(
General Comments 0
You need to be logged in to leave comments. Login now