test_stats.py 864 B

123456789101112131415161718192021222324252627282930
  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={
  13. "organization_id_or_slug": self.organization.slug,
  14. "team_id_or_slug": self.team.slug,
  15. },
  16. )
  17. self.login_as(user=self.user)
  18. def test_get(self):
  19. response = self.client.get(self.url)
  20. request = RequestFactory().get(self.url)
  21. self.validate_schema(request, response)