test_org_repos.py 809 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 OrganizationReposDocs(APIDocsTestCase):
  5. def setUp(self):
  6. organization = self.create_organization(owner=self.user, name="Rowdy Tiger")
  7. project = self.create_project(name="foo", organization=organization, teams=[])
  8. self.create_repo(project=project, name="getsentry/sentry")
  9. self.url = reverse(
  10. "sentry-api-0-organization-repositories",
  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)