diff --git a/tests/test_progit_flask_ui_fork.py b/tests/test_progit_flask_ui_fork.py index c74c4af..3f4de77 100644 --- a/tests/test_progit_flask_ui_fork.py +++ b/tests/test_progit_flask_ui_fork.py @@ -1205,6 +1205,81 @@ index 0000000..2a552bb '
', output.data) + @patch('pagure.lib.notify.send_email') + def test_new_request_pull(self, send_email): + """ Test the new_request_pull endpoint. """ + send_email.return_value = True + + self.test_fork_project() + + tests.create_projects_git( + os.path.join(tests.HERE, 'requests'), bare=True) + + repo = pagure.lib.get_project(self.session, 'test') + fork = pagure.lib.get_project(self.session, 'test', user='foo') + + self.set_up_git_repo( + new_project=fork, branch_from='feature', mtype='FF') + + user = tests.FakeUser() + user.username = 'foo' + with tests.user_set(pagure.APP, user): + output = self.app.get('/foo/diff/master..feature') + self.assertEqual(output.status_code, 404) + + output = self.app.get('/test/diff/master..foo') + self.assertEqual(output.status_code, 400) + + output = self.app.get('/test/diff/foo..master') + self.assertEqual(output.status_code, 400) + + output = self.app.get('/test/diff/feature..master') + self.assertEqual(output.status_code, 200) + self.assertIn( + 'No commits found
', output.data) + + output = self.app.get('/test/diff/master..feature') + self.assertEqual(output.status_code, 200) + self.assertIn( + '