diff --git a/tests/sentry/api/endpoints/test_organization_stats.py b/tests/sentry/api/endpoints/test_organization_stats.py index 10ca77bc8f6047..60292fd37d62ec 100644 --- a/tests/sentry/api/endpoints/test_organization_stats.py +++ b/tests/sentry/api/endpoints/test_organization_stats.py @@ -1,4 +1,3 @@ -import functools import sys from django.urls import reverse @@ -82,16 +81,14 @@ def test_id_filtering(self): teams=[self.create_team(organization=org, members=[self.user])] ) - make_request = functools.partial( - self.client.get, reverse("sentry-api-0-organization-stats", args=[org.slug]) - ) + url = reverse("sentry-api-0-organization-stats", args=[org.slug]) - response = make_request({"id": [project.id], "group": "project"}) + response = self.client.get(url, {"id": str(project.id), "group": "project"}) assert response.status_code == 200, response.content assert project.id in response.data - response = make_request({"id": [sys.maxsize], "group": "project"}) + response = self.client.get(url, {"id": str(sys.maxsize), "group": "project"}) assert project.id not in response.data @@ -106,12 +103,11 @@ def test_project_id_only(self): teams=[self.create_team(organization=org, members=[self.user])] ) - make_request = functools.partial( - self.client.get, reverse("sentry-api-0-organization-stats", args=[org.slug]) + response = self.client.get( + reverse("sentry-api-0-organization-stats", args=[org.slug]), + {"projectID": str(project.id), "group": "project"}, ) - response = make_request({"projectID": [project.id], "group": "project"}) - assert response.status_code == 200, response.content assert project.id in response.data assert project2.id not in response.data diff --git a/tests/snuba/api/endpoints/test_organization_stats_summary.py b/tests/snuba/api/endpoints/test_organization_stats_summary.py index 8b1fe4bfdf0665..e703c5c7edabec 100644 --- a/tests/snuba/api/endpoints/test_organization_stats_summary.py +++ b/tests/snuba/api/endpoints/test_organization_stats_summary.py @@ -1,5 +1,8 @@ +from __future__ import annotations + import functools from datetime import datetime, timedelta, timezone +from typing import Any from django.urls import reverse @@ -736,17 +739,14 @@ def test_category_filter(self): } def test_download(self): - make_request = functools.partial( - self.client.get, - reverse("sentry-api-0-organization-stats-summary", args=[self.org.slug]), - ) - response = make_request( - { - "statsPeriod": "2d", - "interval": "1d", - "field": ["sum(quantity)", "sum(times_seen)"], - "download": True, - } + req: dict[str, Any] = { + "statsPeriod": "2d", + "interval": "1d", + "field": ["sum(quantity)", "sum(times_seen)"], + "download": True, + } + response = self.client.get( + reverse("sentry-api-0-organization-stats-summary", args=[self.org.slug]), req ) assert response.headers["Content-Type"] == "text/csv"