test_by_slug.py 908 B

1234567891011121314151617181920212223242526272829303132
  1. from django.test.client import RequestFactory
  2. from django.urls import reverse
  3. from fixtures.apidocs_test_case import APIDocsTestCase
  4. class TeamsBySlugDocs(APIDocsTestCase):
  5. def setUp(self):
  6. team = self.create_team(organization=self.organization)
  7. self.url = reverse(
  8. "sentry-api-0-team-details",
  9. kwargs={
  10. "organization_id_or_slug": self.organization.slug,
  11. "team_id_or_slug": team.slug,
  12. },
  13. )
  14. self.login_as(user=self.user)
  15. def test_get(self):
  16. response = self.client.get(self.url)
  17. request = RequestFactory().get(self.url)
  18. self.validate_schema(request, response)
  19. def test_put(self):
  20. data = {"name": "foo"}
  21. response = self.client.put(self.url, data)
  22. request = RequestFactory().put(self.url, data)
  23. self.validate_schema(request, response)