def test_sus_list_return_all_cases_paginated(self): DataSus().save(self.db.session, id=1, region='region', state='state', date=datetime.date(2020, 3, 29), newcases=1, totalcases=2, newdeaths=1, totaldeaths=1, update=datetime.date(2020, 3, 29)) DataSus().save(self.db.session, id=2, region='region2', state='state2', date=datetime.date(2020, 3, 29), newcases=1, totalcases=2, newdeaths=1, totaldeaths=1, update=datetime.date(2020, 3, 29)) self.db.session.commit() response = datasus_services.get_sus_list(1) self.assertEqual(len(response.get('sus_list')), 2)
def get(self, page): """SUS Data Paginated List""" response = datasus_services.get_sus_list(page) if not response.get('sus_list'): abort(404, "No cases found for this page") return response
def get(self): """SUS Data List""" response = datasus_services.get_sus_list(None) if not response.get('sus_list'): abort(404, 'No data found') return response