test_org_details.py 857 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 OrganizationDetailsDocs(APIDocsTestCase):
  5. def setUp(self):
  6. organization = self.create_organization(owner=self.user, name="Rowdy Tiger")
  7. self.url = reverse(
  8. "sentry-api-0-organization-details",
  9. kwargs={"organization_slug": organization.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)