test_project_index.py 730 B

12345678910111213141516171819202122
  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 ProjectIndexDocs(APIDocsTestCase):
  7. def setUp(self):
  8. self.org = self.create_organization(owner=self.user)
  9. self.team = self.create_team(organization=self.org, members=[self.user])
  10. self.project = self.create_project(teams=[self.team])
  11. self.login_as(user=self.user)
  12. self.url = reverse("sentry-api-0-projects")
  13. def test_get(self):
  14. response = self.client.get(self.url)
  15. request = RequestFactory().get(self.url)
  16. self.validate_schema(request, response)