From 43d191492cb932b2f79490ce576571b8753471b9 Mon Sep 17 00:00:00 2001 From: Clement Verna Date: Feb 25 2016 16:47:28 +0000 Subject: Added test case for empty initial comment --- diff --git a/tests/test_pagure_flask_ui_fork.py b/tests/test_pagure_flask_ui_fork.py index 822cbae..2417027 100644 --- a/tests/test_pagure_flask_ui_fork.py +++ b/tests/test_pagure_flask_ui_fork.py @@ -1401,6 +1401,7 @@ index 0000000..2a552bb 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', @@ -1415,6 +1416,22 @@ index 0000000..2a552bb output.data) self.assertIn('

Test Initial Comment

', output.data) + + # Case 2 - Add an empty initial comment + data = { + 'csrf_token': csrf_token, + 'title': 'foo bar PR', + 'initial_comment': '', + } + + output = self.app.post( + '/test/diff/master..feature', data=data, follow_redirects=True) + self.assertEqual(output.status_code, 200) + self.assertIn( + 'PR#3: foo bar PR - test\n - Pagure', + output.data) + self.assertNotIn('