diff --git a/tests/test_progit_flask_ui_fork.py b/tests/test_progit_flask_ui_fork.py index d76c97a..d5f153e 100644 --- a/tests/test_progit_flask_ui_fork.py +++ b/tests/test_progit_flask_ui_fork.py @@ -319,7 +319,7 @@ class PagureFlaskForktests(tests.Modeltests): 'Pagure', output.data) self.assertIn( '
PR#1 ' - 'PR from the feature branch', output.data) self.assertIn( '\n Comment removed', output.data) @@ -1568,7 +1568,7 @@ index 0000000..2a552bb self.assertEqual(output.status_code, 200) # Creating comment to play with self.assertTrue( - output.data.startswith(''))
+ output.data.startswith('\n'))
csrf_token = output.data.split(
'name="csrf_token" type="hidden" value="')[1].split('">')[0]
@@ -1584,8 +1584,7 @@ index 0000000..2a552bb
self.assertIn(
'
PR#1 ' - 'PR from the feature branch', output.data) self.assertIn( '\n Comment added', output.data) @@ -1615,7 +1614,7 @@ index 0000000..2a552bb '
This look alright but we can do better than this.
', output.data) self.assertIn( 'PR#1 ' - 'PR from the feature branch', output.data) # Checking if Edited by User is there or not self.assertIn( 'Edited just now by pingou ', diff --git a/tests/test_progit_flask_ui_issues.py b/tests/test_progit_flask_ui_issues.py index 952420d..ca42902 100644 --- a/tests/test_progit_flask_ui_issues.py +++ b/tests/test_progit_flask_ui_issues.py @@ -1162,7 +1162,7 @@ class PagureFlaskIssuestests(tests.Modeltests): output.data) self.assertIn( '#1\n' - ' Test issue #1', + ' Test issue #1', output.data) self.assertEqual(output.data.count( ''), 1) diff --git a/tests/test_progit_flask_ui_no_master_branch.py b/tests/test_progit_flask_ui_no_master_branch.py index 5cf88a5..ee7d194 100644 --- a/tests/test_progit_flask_ui_no_master_branch.py +++ b/tests/test_progit_flask_ui_no_master_branch.py @@ -310,7 +310,8 @@ class PagureFlaskNoMasterBranchtests(tests.Modeltests): tests.create_projects(self.session) # Non-existant git repo output = self.app.get('/test/diff/master..feature') - self.assertEqual(output.status_code, 302) + # (used to be 302 but seeing a diff is allowed even logged out) + self.assertEqual(output.status_code, 404) user = tests.FakeUser() with tests.user_set(pagure.APP, user): @@ -320,7 +321,11 @@ class PagureFlaskNoMasterBranchtests(tests.Modeltests): self.set_up_git_repo() output = self.app.get('/test/diff/master..feature') - self.assertEqual(output.status_code, 302) + # (used to be 302 but seeing a diff is allowed even logged out) + self.assertEqual(output.status_code, 400) + self.assertIn( + ''), 1)
+ self.assertIn('
Branch master could not be found in the target repo
', + output.data) user = tests.FakeUser() with tests.user_set(pagure.APP, user): diff --git a/tests/test_progit_flask_ui_slash_branch_name.py b/tests/test_progit_flask_ui_slash_branch_name.py index 9e53717..38743c7 100644 --- a/tests/test_progit_flask_ui_slash_branch_name.py +++ b/tests/test_progit_flask_ui_slash_branch_name.py @@ -339,7 +339,8 @@ class PagureFlaskSlashInBranchtests(tests.Modeltests): tests.create_projects(self.session) # Non-existant git repo output = self.app.get('/test/diff/master..maxamilion/feature') - self.assertEqual(output.status_code, 302) + # (used to be 302 but seeing a diff is allowed even logged out) + self.assertEqual(output.status_code, 404) user = tests.FakeUser() with tests.user_set(pagure.APP, user): @@ -349,7 +350,10 @@ class PagureFlaskSlashInBranchtests(tests.Modeltests): self.set_up_git_repo() output = self.app.get('/test/diff/master..maxamilion/feature') - self.assertEqual(output.status_code, 302) + # (used to be 302 but seeing a diff is allowed even logged out) + self.assertEqual(output.status_code, 200) + self.assertEqual(output.data.count('.gitignore', output.data) user = tests.FakeUser() with tests.user_set(pagure.APP, user): @@ -357,7 +361,7 @@ class PagureFlaskSlashInBranchtests(tests.Modeltests): self.assertEqual(output.status_code, 200) self.assertEqual( output.data.count(''), 1)
- self.assertIn('
.gitignore
', output.data) + self.assertIn('.gitignore', output.data) if __name__ == '__main__':