def _api_get_contest_by_id(contest_id): """returns a single contest by id """ result = api.ballot_get_contest_by_id(contest_id).get('result') if result: return Contest(contest_id, result) else: return None
def test_api_ballot_get_contest_by_id(self): response = api.ballot_get_contest_by_id(self.get_contest_id()) print(response) self.assertFalse("error" in response) self.assertIsNotNone(response['result'])