From bc4ec4e0febe9e4280fa8fd14c579d5aafe7276d Mon Sep 17 00:00:00 2001 From: Pierre-Yves Chibon Date: Apr 14 2016 10:18:24 +0000 Subject: Test the effect of the OLD_VIEW_COMMIT_ENABLED configuration key --- diff --git a/tests/test_pagure_flask_ui_repo.py b/tests/test_pagure_flask_ui_repo.py index 915999a..dfd0e56 100644 --- a/tests/test_pagure_flask_ui_repo.py +++ b/tests/test_pagure_flask_ui_repo.py @@ -1076,6 +1076,14 @@ class PagureFlaskRepotests(tests.Modeltests): self.assertTrue( '+ ======' in output.data) + # View first commit - with the old URL scheme disabled + pagure.APP.config['OLD_VIEW_COMMIT_ENABLED'] = False + output = self.app.get( + '/test/%s' % commit.oid.hex, follow_redirects=True) + self.assertEqual(output.status_code, 404) + self.assertIn('

Project not found

', output.data) + pagure.APP.config['OLD_VIEW_COMMIT_ENABLED'] = True + # View first commit - with the old URL scheme output = self.app.get( '/test/%s' % commit.oid.hex, follow_redirects=True)