diff --git a/pagure/ui/issues.py b/pagure/ui/issues.py index 6d1b74b..25b633b 100644 --- a/pagure/ui/issues.py +++ b/pagure/ui/issues.py @@ -999,7 +999,6 @@ def view_issue(repo, issueid, username=None, namespace=None): knowns_keys=knowns_keys, subscribers=pagure.lib.get_watch_list(SESSION, issue), attachments=issue.attachments, - subscribed=subscribed, ) diff --git a/tests/test_pagure_flask_ui_repo.py b/tests/test_pagure_flask_ui_repo.py index 2454ef5..816c0c3 100644 --- a/tests/test_pagure_flask_ui_repo.py +++ b/tests/test_pagure_flask_ui_repo.py @@ -264,13 +264,37 @@ class PagureFlaskRepotests(tests.Modeltests): 'user': 'ralph', } + # Missing access output = self.app.post('/test/adduser', data=data) self.assertEqual(output.status_code, 200) + self.assertIn( + 'Add user - test - Pagure', output.data) self.assertTrue('Add user to the' in output.data) data['csrf_token'] = csrf_token output = self.app.post('/test/adduser', data=data) self.assertEqual(output.status_code, 200) + self.assertIn( + 'Add user - test - Pagure', output.data) + self.assertIn('Add user to the', output.data) + + data = { + 'user': 'ralph', + 'access': 'commit', + } + + # No CSRF + output = self.app.post('/test/adduser', data=data) + self.assertEqual(output.status_code, 200) + self.assertIn( + 'Add user - test - Pagure', output.data) + + # Unknown user + data['csrf_token'] = csrf_token + output = self.app.post('/test/adduser', data=data) + self.assertEqual(output.status_code, 200) + self.assertIn( + 'Add user - test - Pagure', output.data) self.assertIn('Add user to the', output.data) self.assertIn( '\n No user "ralph" ' @@ -412,18 +436,33 @@ class PagureFlaskRepotests(tests.Modeltests): 'group': 'ralph', } + # Missing CSRF output = self.app.post('/test/addgroup', data=data) self.assertEqual(output.status_code, 200) - self.assertTrue('Add group to the' in output.data) + self.assertIn( + 'Add group - test - Pagure', output.data) + self.assertIn('Add group to the', output.data) + # Missing access data['csrf_token'] = csrf_token output = self.app.post('/test/addgroup', data=data) self.assertEqual(output.status_code, 200) - self.assertTrue('Add group to the' in output.data) + self.assertIn( + 'Add group - test - Pagure', output.data) + self.assertIn('Add group to the', output.data) + + # Unknown group + data['access'] = 'ticket' + output = self.app.post('/test/addgroup', data=data) + self.assertEqual(output.status_code, 200) + self.assertIn( + 'Add group - test - Pagure', output.data) + self.assertIn('Add group to the', output.data) self.assertIn( '\n No group ralph found.', output.data) + # All good data['group'] = 'foo' output = self.app.post( '/test/addgroup', data=data, follow_redirects=True) @@ -609,8 +648,8 @@ class PagureFlaskRepotests(tests.Modeltests): 'Settings - test - Pagure', output.data) self.assertIn('

Settings for test

', output.data) self.assertIn( - '\n User does not have commit rights, ' - 'or cannot have them removed', output.data) + '\n User does not have any ' + 'access on the repo', output.data) # Add an user to a project repo = pagure.lib.get_project(self.session, 'test') diff --git a/tests/test_pagure_flask_ui_repo_slash_name.py b/tests/test_pagure_flask_ui_repo_slash_name.py index 63207f8..432430b 100644 --- a/tests/test_pagure_flask_ui_repo_slash_name.py +++ b/tests/test_pagure_flask_ui_repo_slash_name.py @@ -113,7 +113,7 @@ class PagureFlaskSlashInNametests(tests.Modeltests): self.assertEqual(output.status_code, 200) self.assertIn( '
\n ' - '
Owners
', output.data) + '
Contributors
', output.data) self.assertIn( '

The Project Creator has not pushed any code yet

', output.data) @@ -156,7 +156,7 @@ class PagureFlaskSlashInNametests(tests.Modeltests): self.assertEqual(output.status_code, 200) self.assertIn( '
\n ' - '
Owners
', output.data) + '
Contributors
', output.data) self.assertIn( '

The Project Creator has not pushed any code yet

', output.data) @@ -188,7 +188,7 @@ class PagureFlaskSlashInNametests(tests.Modeltests): self.assertEqual(output.status_code, 200) self.assertIn( '
\n ' - '
Owners
', output.data) + '
Contributors
', output.data) # We can't create the project `forks/test` the normal way self.assertRaises( @@ -227,7 +227,7 @@ class PagureFlaskSlashInNametests(tests.Modeltests): self.assertEqual(output.status_code, 200) self.assertIn( '
\n ' - '
Owners
', output.data) + '
Contributors
', output.data) self.assertIn('Add sources file for testing', output.data) self.assertIn( 'Overview - forks/test - Pagure', output.data) diff --git a/tests/test_pagure_flask_ui_slash_branch_name.py b/tests/test_pagure_flask_ui_slash_branch_name.py index 0e42dd7..4106461 100644 --- a/tests/test_pagure_flask_ui_slash_branch_name.py +++ b/tests/test_pagure_flask_ui_slash_branch_name.py @@ -141,7 +141,7 @@ class PagureFlaskSlashInBranchtests(tests.Modeltests): self.assertEqual(output.status_code, 200) self.assertIn( '
\n ' - '
Owners
', output.data) + '
Contributors
', output.data) @patch('pagure.lib.notify.send_email') def test_view_repo_branch(self, send_email): @@ -162,7 +162,7 @@ class PagureFlaskSlashInBranchtests(tests.Modeltests): self.assertEqual(output.status_code, 200) self.assertIn( '
\n ' - '
Owners
', output.data) + '
Contributors
', output.data) @patch('pagure.lib.notify.send_email') def test_view_commits(self, send_email):