test_projects.py 791 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 TeamsProjectsDocs(APIDocsTestCase):
  5. def setUp(self):
  6. team = self.create_team(organization=self.organization)
  7. self.create_project(name="foo", organization=self.organization, teams=[team])
  8. self.url = reverse(
  9. "sentry-api-0-team-project-index",
  10. kwargs={
  11. "organization_id_or_slug": self.organization.slug,
  12. "team_id_or_slug": team.slug,
  13. },
  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)