From 9e69c0939e843a28aab2ddd816ceefce55915eab Mon Sep 17 00:00:00 2001 From: Pierre-Yves Chibon Date: Apr 20 2015 11:21:12 +0000 Subject: Add check for trying to create a ticket on a project that has the issue tracker disabled --- diff --git a/tests/test_progit_flask_ui_issues.py b/tests/test_progit_flask_ui_issues.py index dc630ca..fc41f83 100644 --- a/tests/test_progit_flask_ui_issues.py +++ b/tests/test_progit_flask_ui_issues.py @@ -122,6 +122,18 @@ class PagureFlaskIssuestests(tests.Modeltests): in output.data) self.assertTrue('

\n Issues (1)\n

' in output.data) + # Project w/o issue tracker + repo = pagure.lib.get_project(self.session, 'test') + repo.settings = {'issue_tracker': False} + self.session.add(repo) + self.session.commit() + + user.username = 'pingou' + with tests.user_set(pagure.APP, user): + output = self.app.post( + '/test/new_issue', data=data, follow_redirects=True) + self.assertEqual(output.status_code, 404) + @patch('pagure.lib.git.update_git') @patch('pagure.lib.notify.send_email') def test_view_issues(self, p_send_email, p_ugt):