##// END OF EJS Templates
tests: Add test to check PR page when target reference is missing....
Martin Bornhold -
r1079:02683dd7 default
parent child Browse files
Show More
@@ -207,6 +207,28 b' class TestPullrequestsController:'
207 UpdateFailureReason.MISSING_SOURCE_REF]
207 UpdateFailureReason.MISSING_SOURCE_REF]
208 assert_session_flash(response, expected_msg, category='error')
208 assert_session_flash(response, expected_msg, category='error')
209
209
210 def test_missing_target_reference(self, pr_util, csrf_token):
211 from rhodecode.lib.vcs.backends.base import MergeFailureReason
212 pull_request = pr_util.create_pull_request(
213 approved=True, mergeable=True)
214 pull_request.target_ref = 'branch:invalid-branch:invalid-commit-id'
215 Session().add(pull_request)
216 Session().commit()
217
218 pull_request_id = pull_request.pull_request_id
219 pull_request_url = url(
220 controller='pullrequests', action='show',
221 repo_name=pull_request.target_repo.repo_name,
222 pull_request_id=str(pull_request_id))
223
224 response = self.app.get(pull_request_url)
225
226 assertr = AssertResponse(response)
227 expected_msg = PullRequestModel.MERGE_STATUS_MESSAGES[
228 MergeFailureReason.MISSING_TARGET_REF]
229 assertr.element_contains(
230 'span[data-role="merge-message"]', str(expected_msg))
231
210 def test_comment_and_close_pull_request(self, pr_util, csrf_token):
232 def test_comment_and_close_pull_request(self, pr_util, csrf_token):
211 pull_request = pr_util.create_pull_request(approved=True)
233 pull_request = pr_util.create_pull_request(approved=True)
212 pull_request_id = pull_request.pull_request_id
234 pull_request_id = pull_request.pull_request_id
General Comments 0
You need to be logged in to leave comments. Login now