Show More
@@ -619,7 +619,12 b' class ComparePage(AssertResponse):' | |||
|
619 | 619 | self.contains_one_anchor(file_id) |
|
620 | 620 | diffblock = doc.cssselect('[data-f-path="%s"]' % filename) |
|
621 | 621 | assert len(diffblock) == 2 |
|
622 |
|
|
|
622 | for lnk in diffblock[0].cssselect('a'): | |
|
623 | if 'permalink' in lnk.text: | |
|
624 | assert '#{}'.format(file_id) in lnk.attrib['href'] | |
|
625 | break | |
|
626 | else: | |
|
627 | pytest.fail('Unable to find permalink') | |
|
623 | 628 | |
|
624 | 629 | def contains_change_summary(self, files_changed, inserted, deleted): |
|
625 | 630 | template = ( |
@@ -150,9 +150,9 b' class TestPullrequestsView(object):' | |||
|
150 | 150 | response = self.app.post( |
|
151 | 151 | route_path('pullrequest_create', repo_name=source.repo_name), |
|
152 | 152 | [ |
|
153 |
('source_repo', source |
|
|
153 | ('source_repo', source_repo_name), | |
|
154 | 154 | ('source_ref', source_ref), |
|
155 |
('target_repo', target |
|
|
155 | ('target_repo', target_repo_name), | |
|
156 | 156 | ('target_ref', target_ref), |
|
157 | 157 | ('common_ancestor', commit_ids['initial-commit']), |
|
158 | 158 | ('pullrequest_title', 'Title'), |
@@ -1110,16 +1110,17 b' class TestPullrequestsView(object):' | |||
|
1110 | 1110 | |
|
1111 | 1111 | # source has ancestor - change - change-2 |
|
1112 | 1112 | backend.pull_heads(source, heads=['change-2']) |
|
1113 | target_repo_name = target.repo_name | |
|
1113 | 1114 | |
|
1114 | 1115 | # update PR |
|
1115 | 1116 | self.app.post( |
|
1116 | 1117 | route_path('pullrequest_update', |
|
1117 |
repo_name=target |
|
|
1118 | repo_name=target_repo_name, pull_request_id=pull_request_id), | |
|
1118 | 1119 | params={'update_commits': 'true', 'csrf_token': csrf_token}) |
|
1119 | 1120 | |
|
1120 | 1121 | response = self.app.get( |
|
1121 | 1122 | route_path('pullrequest_show', |
|
1122 |
repo_name=target |
|
|
1123 | repo_name=target_repo_name, | |
|
1123 | 1124 | pull_request_id=pull_request.pull_request_id)) |
|
1124 | 1125 | |
|
1125 | 1126 | assert response.status_int == 200 |
@@ -1166,10 +1167,11 b' class TestPullrequestsView(object):' | |||
|
1166 | 1167 | # source has ancestor - ancestor-new - change-rebased |
|
1167 | 1168 | backend.pull_heads(target, heads=['ancestor-new']) |
|
1168 | 1169 | backend.pull_heads(source, heads=['change-rebased']) |
|
1170 | target_repo_name = target.repo_name | |
|
1169 | 1171 | |
|
1170 | 1172 | # update PR |
|
1171 | 1173 | url = route_path('pullrequest_update', |
|
1172 |
repo_name=target |
|
|
1174 | repo_name=target_repo_name, | |
|
1173 | 1175 | pull_request_id=pull_request_id) |
|
1174 | 1176 | self.app.post(url, |
|
1175 | 1177 | params={'update_commits': 'true', 'csrf_token': csrf_token}, |
@@ -1183,7 +1185,7 b' class TestPullrequestsView(object):' | |||
|
1183 | 1185 | |
|
1184 | 1186 | response = self.app.get( |
|
1185 | 1187 | route_path('pullrequest_show', |
|
1186 |
repo_name=target |
|
|
1188 | repo_name=target_repo_name, | |
|
1187 | 1189 | pull_request_id=pull_request.pull_request_id)) |
|
1188 | 1190 | assert response.status_int == 200 |
|
1189 | 1191 | response.mustcontain('Pull request updated to') |
@@ -1232,16 +1234,17 b' class TestPullrequestsView(object):' | |||
|
1232 | 1234 | vcsrepo = target.scm_instance() |
|
1233 | 1235 | vcsrepo.config.clear_section('hooks') |
|
1234 | 1236 | vcsrepo.run_git_command(['reset', '--soft', 'HEAD~2']) |
|
1237 | target_repo_name = target.repo_name | |
|
1235 | 1238 | |
|
1236 | 1239 | # update PR |
|
1237 | 1240 | url = route_path('pullrequest_update', |
|
1238 |
repo_name=target |
|
|
1241 | repo_name=target_repo_name, | |
|
1239 | 1242 | pull_request_id=pull_request_id) |
|
1240 | 1243 | self.app.post(url, |
|
1241 | 1244 | params={'update_commits': 'true', 'csrf_token': csrf_token}, |
|
1242 | 1245 | status=200) |
|
1243 | 1246 | |
|
1244 |
response = self.app.get(route_path('pullrequest_new', repo_name=target |
|
|
1247 | response = self.app.get(route_path('pullrequest_new', repo_name=target_repo_name)) | |
|
1245 | 1248 | assert response.status_int == 200 |
|
1246 | 1249 | response.mustcontain('Pull request updated to') |
|
1247 | 1250 | response.mustcontain('with 0 added, 0 removed commits.') |
@@ -1280,11 +1283,12 b' class TestPullrequestsView(object):' | |||
|
1280 | 1283 | # source has ancestor - ancestor-new - change-rebased |
|
1281 | 1284 | backend.pull_heads(target, heads=['ancestor-new']) |
|
1282 | 1285 | backend.pull_heads(source, heads=['change-rebased']) |
|
1286 | target_repo_name = target.repo_name | |
|
1283 | 1287 | |
|
1284 | 1288 | # update PR |
|
1285 | 1289 | self.app.post( |
|
1286 | 1290 | route_path('pullrequest_update', |
|
1287 |
repo_name=target |
|
|
1291 | repo_name=target_repo_name, pull_request_id=pull_request_id), | |
|
1288 | 1292 | params={'update_commits': 'true', 'csrf_token': csrf_token}, |
|
1289 | 1293 | status=200) |
|
1290 | 1294 | |
@@ -1389,6 +1393,8 b' class TestPullrequestsView(object):' | |||
|
1389 | 1393 | pull_request = pr_util.create_pull_request( |
|
1390 | 1394 | commits, target_head='old-feature', source_head='new-feature', |
|
1391 | 1395 | revisions=['new-feature'], mergeable=True) |
|
1396 | pr_id = pull_request.pull_request_id | |
|
1397 | target_repo_name = pull_request.target_repo.repo_name | |
|
1392 | 1398 | |
|
1393 | 1399 | vcs = pr_util.source_repository.scm_instance() |
|
1394 | 1400 | if backend.alias == 'git': |
@@ -1397,8 +1403,8 b' class TestPullrequestsView(object):' | |||
|
1397 | 1403 | vcs.strip(pr_util.commit_ids['new-feature']) |
|
1398 | 1404 | |
|
1399 | 1405 | url = route_path('pullrequest_update', |
|
1400 |
repo_name= |
|
|
1401 |
pull_request_id=p |
|
|
1406 | repo_name=target_repo_name, | |
|
1407 | pull_request_id=pr_id) | |
|
1402 | 1408 | response = self.app.post(url, |
|
1403 | 1409 | params={'update_commits': 'true', |
|
1404 | 1410 | 'csrf_token': csrf_token}) |
@@ -1409,8 +1415,8 b' class TestPullrequestsView(object):' | |||
|
1409 | 1415 | # Make sure that after update, it won't raise 500 errors |
|
1410 | 1416 | response = self.app.get(route_path( |
|
1411 | 1417 | 'pullrequest_show', |
|
1412 |
repo_name= |
|
|
1413 |
pull_request_id=p |
|
|
1418 | repo_name=target_repo_name, | |
|
1419 | pull_request_id=pr_id)) | |
|
1414 | 1420 | |
|
1415 | 1421 | assert response.status_int == 200 |
|
1416 | 1422 | response.assert_response().element_contains( |
General Comments 0
You need to be logged in to leave comments.
Login now