test_by_slug.py 855 B

1234567891011121314151617181920212223242526272829
  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={"organization_slug": self.organization.slug, "team_id_or_slug": team.slug},
  10. )
  11. self.login_as(user=self.user)
  12. def test_get(self):
  13. response = self.client.get(self.url)
  14. request = RequestFactory().get(self.url)
  15. self.validate_schema(request, response)
  16. def test_put(self):
  17. data = {"name": "foo"}
  18. response = self.client.put(self.url, data)
  19. request = RequestFactory().put(self.url, data)
  20. self.validate_schema(request, response)