test_org_projects.py 808 B

123456789101112131415161718192021222324
  1. from django.test.client import RequestFactory
  2. from django.urls import reverse
  3. from fixtures.apidocs_test_case import APIDocsTestCase
  4. class OrganizationProjectsDocs(APIDocsTestCase):
  5. def setUp(self):
  6. organization = self.create_organization(owner=self.user, name="Rowdy Tiger")
  7. self.create_project(name="foo", organization=organization, teams=[])
  8. self.create_project(name="bar", organization=organization, teams=[])
  9. self.url = reverse(
  10. "sentry-api-0-organization-projects",
  11. kwargs={"organization_id_or_slug": organization.slug},
  12. )
  13. self.login_as(user=self.user)
  14. def test_get(self):
  15. response = self.client.get(self.url)
  16. request = RequestFactory().get(self.url)
  17. self.validate_schema(request, response)