test_details.py 870 B

1234567891011121314151617181920212223242526272829
  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
  6. class ProjectDetailsDocs(APIDocsTestCase):
  7. def setUp(self):
  8. self.url = reverse(
  9. "sentry-api-0-project-details",
  10. kwargs={"organization_slug": self.organization.slug, "project_slug": self.project.slug},
  11. )
  12. self.login_as(user=self.user)
  13. def test_get(self):
  14. response = self.client.get(self.url)
  15. request = RequestFactory().get(self.url)
  16. self.validate_schema(request, response)
  17. def test_put(self):
  18. data = {"name": "foo"}
  19. response = self.client.put(self.url, data)
  20. request = RequestFactory().put(self.url, data)
  21. self.validate_schema(request, response)