test_org_details.py 939 B

12345678910111213141516171819202122232425262728293031
  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.silo import region_silo_test
  5. @region_silo_test(stable=True)
  6. class OrganizationDetailsDocs(APIDocsTestCase):
  7. def setUp(self):
  8. organization = self.create_organization(owner=self.user, name="Rowdy Tiger")
  9. self.url = reverse(
  10. "sentry-api-0-organization-details",
  11. kwargs={"organization_slug": organization.slug},
  12. )
  13. self.login_as(user=self.user)
  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_put(self):
  19. data = {"name": "foo"}
  20. response = self.client.put(self.url, data)
  21. request = RequestFactory().put(self.url, data)
  22. self.validate_schema(request, response)