test_repo_commits.py 969 B

1234567891011121314151617181920212223242526
  1. from django.test.client import RequestFactory
  2. from django.urls import reverse
  3. from fixtures.apidocs_test_case import APIDocsTestCase
  4. class OrganizationRepoCommitsDocs(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. repo = self.create_repo(project=project, name="getsentry/sentry")
  9. release = self.create_release(project=project)
  10. self.create_commit(project=project, repo=repo, release=release)
  11. self.url = reverse(
  12. "sentry-api-0-organization-repository-commits",
  13. kwargs={"organization_slug": organization.slug, "repo_id": repo.id},
  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)