test_org_projects.py 884 B

1234567891011121314151617181920212223242526
  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(stable=True)
  6. class OrganizationProjectsDocs(APIDocsTestCase):
  7. def setUp(self):
  8. organization = self.create_organization(owner=self.user, name="Rowdy Tiger")
  9. self.create_project(name="foo", organization=organization, teams=[])
  10. self.create_project(name="bar", organization=organization, teams=[])
  11. self.url = reverse(
  12. "sentry-api-0-organization-projects",
  13. kwargs={"organization_slug": organization.slug},
  14. )
  15. self.login_as(user=self.user)
  16. def test_get(self):
  17. response = self.client.get(self.url)
  18. request = RequestFactory().get(self.url)
  19. self.validate_schema(request, response)