From c62a10d643c637c89bee799a85896ec2da25b561 Mon Sep 17 00:00:00 2001 From: Pierre-Yves Chibon Date: Aug 14 2015 21:19:49 +0000 Subject: Improve unit-test for the change_ref_head endpoint --- diff --git a/tests/test_progit_flask_ui_repo.py b/tests/test_progit_flask_ui_repo.py index b6b49b1..f329f67 100644 --- a/tests/test_progit_flask_ui_repo.py +++ b/tests/test_progit_flask_ui_repo.py @@ -1772,7 +1772,7 @@ index 0000000..fb7093d @patch('pagure.ui.repo.admin_session_timedout') def test_change_ref_head(self,ast): """ Test the change_ref_head endpoint. """ - ast.return_value = False + ast.return_value = True output = self.app.post('/foo/default/branch/') self.assertEqual(output.status_code, 302) @@ -1780,6 +1780,11 @@ index 0000000..fb7093d user = tests.FakeUser() with tests.user_set(pagure.APP, user): output = self.app.post('/foo/default/branch/') + self.assertEqual(output.status_code, 302) + + ast.return_value = False + + output = self.app.post('/foo/default/branch/') self.assertEqual(output.status_code, 404) tests.create_projects(self.session)