test_project_events.py 797 B

123456789101112131415161718192021222324252627282930
  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 ProjectEventsDocs(APIDocsTestCase):
  7. endpoint = "sentry-api-0-project-events"
  8. def setUp(self):
  9. self.create_event("a")
  10. self.create_event("b")
  11. self.url = reverse(
  12. self.endpoint,
  13. kwargs={
  14. "organization_slug": self.organization.slug,
  15. "project_slug": self.project.slug,
  16. },
  17. )
  18. self.login_as(user=self.user)
  19. def test_get(self):
  20. response = self.client.get(self.url)
  21. request = RequestFactory().get(self.url)
  22. self.validate_schema(request, response)