diff --git a/tests/test_pagure_flask_ui_app.py b/tests/test_pagure_flask_ui_app.py index 3e2d9c6..150b60d 100644 --- a/tests/test_pagure_flask_ui_app.py +++ b/tests/test_pagure_flask_ui_app.py @@ -932,46 +932,22 @@ class ViewMyRequestsTests(tests.Modeltests): def test_view_my_requests(self): """Test the index endpoint. """ - user = tests.FakeUser(username='jcline') - with tests.user_set(pagure.APP, user): - output = self.app.get('/user/jcline/requests') - self.assertEqual(output.status_code, 200) + output = self.app.get('/user/pingou/requests') + self.assertEqual(output.status_code, 200) class ViewMyIssuesTests(tests.Modeltests): - @classmethod - def setUpClass(cls): - """ Set up the environnment, ran before every tests. """ - super(ViewMyIssuesTests, cls).setUpClass() - tests.create_projects(cls.session) - tests.create_projects_git( - os.path.join(cls.path, 'tickets'), bare=True) - tests.create_tokens(cls.session) - tests.create_tokens_acl(cls.session) - - headers = {'Authorization': 'token aaabbbcccddd'} - data = { - 'title': 'test issue', - 'issue_content': 'This issue needs attention', - } - - # Valid request - cls.app.post('/api/0/test/new_issue', data=data, headers=headers) - def test_view_my_issues_no_user(self): - """Test the endpoint.""" + """Test the endpoint returns 404 with a missing user.""" output = self.app.get('/user/somenonexistentuser/issues') self.assertEqual(output.status_code, 404) def test_view_my_issues(self): - """Test the index endpoint. """ - user = tests.FakeUser(username='jcline') - with tests.user_set(pagure.APP, user): - output = self.app.get('/user/jcline/issues') - self.assertEqual(output.status_code, 200) + """Test the endpoint returns 200 when the user exists.""" + output = self.app.get('/user/pingou/issues') + self.assertEqual(output.status_code, 200) if __name__ == '__main__': - SUITE = unittest.TestLoader().loadTestsFromTestCase(PagureFlaskApptests) - unittest.TextTestRunner(verbosity=2).run(SUITE) + unittest.main()