| |
@@ -1173,10 +1173,10 @@
|
| |
os.path.join(tests.HERE, 'requests'), bare=True)
|
| |
self.set_up_git_repo(new_project=None, branch_from='feature')
|
| |
|
| |
- # No such project
|
| |
user = tests.FakeUser()
|
| |
- user.username = 'foo'
|
| |
+ user.username = 'pingou'
|
| |
with tests.user_set(pagure.APP, user):
|
| |
+ # No such project
|
| |
output = self.app.post('/foo/pull-request/1/assign')
|
| |
self.assertEqual(output.status_code, 404)
|
| |
|
| |
@@ -1192,7 +1192,7 @@
|
| |
'Pagure</title>', output.data)
|
| |
self.assertIn(
|
| |
'<h3><span class="label label-default">PR#1</span>\n'
|
| |
- ' PR from the feature branch\n</h3>', output.data)
|
| |
+ ' PR from the feature branch\n', output.data)
|
| |
self.assertNotIn(
|
| |
'</button>\n Request assigned',
|
| |
output.data)
|
| |
@@ -1217,7 +1217,7 @@
|
| |
'Pagure</title>', output.data)
|
| |
self.assertIn(
|
| |
'<h3><span class="label label-default">PR#1</span>\n'
|
| |
- ' PR from the feature branch\n</h3>', output.data)
|
| |
+ ' PR from the feature branch\n', output.data)
|
| |
self.assertNotIn(
|
| |
'</button>\n Request assigned',
|
| |
output.data)
|
| |
@@ -1237,7 +1237,7 @@
|
| |
'Pagure</title>', output.data)
|
| |
self.assertIn(
|
| |
'<h3><span class="label label-default">PR#1</span>\n'
|
| |
- ' PR from the feature branch\n</h3>', output.data)
|
| |
+ ' PR from the feature branch\n', output.data)
|
| |
self.assertIn(
|
| |
'</button>\n No user "bar" found',
|
| |
output.data)
|
| |
@@ -1248,6 +1248,15 @@
|
| |
'user': 'pingou',
|
| |
}
|
| |
|
| |
+ user.username = 'foo'
|
| |
+ with tests.user_set(pagure.APP, user):
|
| |
+ output = self.app.post(
|
| |
+ '/test/pull-request/1/assign', data=data,
|
| |
+ follow_redirects=True)
|
| |
+ self.assertEqual(output.status_code, 403)
|
| |
+
|
| |
+ user.username = 'pingou'
|
| |
+ with tests.user_set(pagure.APP, user):
|
| |
output = self.app.post(
|
| |
'/test/pull-request/1/assign', data=data,
|
| |
follow_redirects=True)
|
| |
@@ -1257,7 +1266,7 @@
|
| |
'Pagure</title>', output.data)
|
| |
self.assertIn(
|
| |
'<h3><span class="label label-default">PR#1</span>\n'
|
| |
- ' PR from the feature branch\n</h3>', output.data)
|
| |
+ ' PR from the feature branch\n', output.data)
|
| |
self.assertIn(
|
| |
'</button>\n Request assigned',
|
| |
output.data)
|
| |
Changes the PR assignment permission to only allow
repo admins to assign PRs, which is the same as the
current behaviour for assigning Issues.
Fixes #985