def test_fetch_and_delete(self): self.post_json("/api/report/generate", {'type': REPORT.TASK_REPORT}, headers=self.api_headers) self.execute_tasks_until_empty() reports = Report.Fetch(self.u) self.assertEqual(len(reports), 1) # Delete reports[0].clean_delete() reports = Report.Fetch(self.u) self.assertEqual(len(reports), 0)
def list(self, d): _max = self.request.get_range('max', max_value=500, default=100) reports = Report.Fetch(self.user, limit=_max) data = { 'reports': [r.json() for r in reports] } self.set_response(data=data, success=True)