test_repo_commits.py 1.0 KB

12345678910111213141516171819202122232425262728
  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 OrganizationRepoCommitsDocs(APIDocsTestCase):
  7. def setUp(self):
  8. organization = self.create_organization(owner=self.user, name="Rowdy Tiger")
  9. project = self.create_project(name="foo", organization=organization, teams=[])
  10. repo = self.create_repo(project=project, name="getsentry/sentry")
  11. release = self.create_release(project=project)
  12. self.create_commit(project=project, repo=repo, release=release)
  13. self.url = reverse(
  14. "sentry-api-0-organization-repository-commits",
  15. kwargs={"organization_slug": organization.slug, "repo_id": repo.id},
  16. )
  17. self.login_as(user=self.user)
  18. def test_get(self):
  19. response = self.client.get(self.url)
  20. request = RequestFactory().get(self.url)
  21. self.validate_schema(request, response)