diff --git a/gdrive/analytics_api.py b/gdrive/analytics_api.py index 95c36ee..4b1189c 100644 --- a/gdrive/analytics_api.py +++ b/gdrive/analytics_api.py @@ -46,11 +46,9 @@ async def run_analytics(background_tasks: BackgroundTasks, req: AnalyticsRequest ) except ValueError as err: - message = str(err) return responses.JSONResponse( status_code=422, - content="Failed (invalid date parameters): [%s, %s] %s" - % (req.startDate, req.endDate, message), + content="Failed (invalid date parameters): %s" % (err), ) diff --git a/tests/test_api.py b/tests/test_api.py index 3359e2c..74cadcf 100644 --- a/tests/test_api.py +++ b/tests/test_api.py @@ -7,7 +7,7 @@ from fastapi import testclient # pylint: disable=wrong-import-position -sys.modules["gdrive.client"] = MagicMock() +sys.modules["gdrive.drive_client"] = MagicMock() from gdrive import main client = testclient.TestClient(main.app)