test_org_stats.py 727 B

12345678910111213141516171819202122232425
  1. from django.test.client import RequestFactory
  2. from django.urls import reverse
  3. from fixtures.apidocs_test_case import APIDocsTestCase
  4. from sentry.testutils.silo import region_silo_test
  5. @region_silo_test
  6. class OrganizationStatsDocs(APIDocsTestCase):
  7. def setUp(self):
  8. self.create_event("a", message="oh no")
  9. self.create_event("b", message="oh no")
  10. self.url = reverse(
  11. "sentry-api-0-organization-stats",
  12. kwargs={"organization_slug": self.organization.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)