test_group_index.py 1.1 KB

1234567891011121314151617181920212223242526272829303132
  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.cases import SCIMTestCase
  5. class SCIMTeamIndexDocs(APIDocsTestCase, SCIMTestCase):
  6. def setUp(self):
  7. super().setUp()
  8. self.member = self.create_member(user=self.create_user(), organization=self.organization)
  9. self.team = self.create_team(organization=self.organization, members=[self.user])
  10. self.url = reverse(
  11. "sentry-api-0-organization-scim-team-index",
  12. kwargs={"organization_slug": self.organization.slug},
  13. )
  14. def test_get(self):
  15. response = self.client.get(self.url)
  16. request = RequestFactory().get(self.url)
  17. self.validate_schema(request, response)
  18. def test_post(self):
  19. post_data = {
  20. "schemas": ["urn:ietf:params:scim:schemas:core:2.0:Group"],
  21. "displayName": "Test SCIMv2",
  22. "members": [],
  23. }
  24. response = self.client.post(self.url, post_data)
  25. request = RequestFactory().post(self.url, post_data)
  26. self.validate_schema(request, response)