diff --git a/tests/test_pagure_flask_ui_fork.py b/tests/test_pagure_flask_ui_fork.py index 63861b1..8aff525 100644 --- a/tests/test_pagure_flask_ui_fork.py +++ b/tests/test_pagure_flask_ui_fork.py @@ -1452,6 +1452,58 @@ index 0000000..2a552bb self.assertNotIn('
Create new Pull Request for master - test\n - ' + 'Pagure', output.data) + self.assertIn( + '', + output.data) + + csrf_token = output.data.split( + 'name="csrf_token" type="hidden" value="')[1].split('">')[0] + + # Case 1 - Add an initial comment + data = { + 'csrf_token': csrf_token, + 'title': 'foo bar PR', + 'initial_comment': 'Test Initial Comment', + } + + output = self.app.post( + '/test/diff/master..feature', data=data, follow_redirects=True) + self.assertEqual(output.status_code, 200) + self.assertIn( + 'PR#2: foo bar PR - test\n - Pagure', + output.data) + self.assertIn('

Test Initial Comment

', output.data) + + # Check if commit start and stop have been set for PR#2 + request = pagure.lib.search_pull_requests( + self.session, project_id=1, requestid=2) + self.assertIsNotNone(request.commit_start) + self.assertIsNotNone(request.commit_stop) + + @patch('pagure.lib.notify.send_email') def test_new_request_pull_empty_repo(self, send_email): """ Test the new_request_pull endpoint against an empty repo. """ send_email.return_value = True