From e83d2d9369d1f8dc8cf327c789b0e8640a4756d2 Mon Sep 17 00:00:00 2001 From: Vivek Anand Date: Mar 14 2017 14:55:57 +0000 Subject: Unit test: view_issues via api when status=all and since Signed-off-by: Vivek Anand --- diff --git a/tests/test_pagure_flask_api_issue.py b/tests/test_pagure_flask_api_issue.py index 94eabd6..a6d3bd8 100644 --- a/tests/test_pagure_flask_api_issue.py +++ b/tests/test_pagure_flask_api_issue.py @@ -1013,6 +1013,29 @@ class PagureFlaskApiIssuetests(tests.Modeltests): } ) + # Test since when status is 'all' + output = self.app.get( + '/api/0/test/issues?status=all&since=1431414700', headers=headers) + self.assertEqual(output.status_code, 200) + data = json.loads(output.data) + for idx in range(len(data['issues'])): + data['issues'][idx]['last_updated'] = '1431414800' + data['issues'][idx]['date_created'] = '1431414800' + self.assertDictEqual( + data, + { + "args": { + "assignee": None, + "author": None, + "since": '1431414700', + "status": "all", + "tags": [] + }, + "issues": FULL_ISSUE_LIST, + "total_issues": 9 + } + ) + def test_api_view_issue(self): """ Test the api_view_issue method of the flask api. """ self.test_api_new_issue()