test_stats.py 811 B

123456789101112131415161718192021222324252627
  1. from django.test.client import RequestFactory
  2. from django.urls import reverse
  3. from fixtures.apidocs_test_case import APIDocsTestCase
  4. class TeamsStatsDocs(APIDocsTestCase):
  5. def setUp(self):
  6. self.team = self.create_team(organization=self.organization, members=[self.user])
  7. self.project.add_team(self.team)
  8. self.create_event("a", message="oh no")
  9. self.create_event("b", message="oh my")
  10. self.url = reverse(
  11. "sentry-api-0-team-stats",
  12. kwargs={"organization_slug": self.organization.slug, "team_id_or_slug": self.team.slug},
  13. )
  14. self.login_as(user=self.user)
  15. def test_get(self):
  16. response = self.client.get(self.url)
  17. request = RequestFactory().get(self.url)
  18. self.validate_schema(request, response)