test_details.py 801 B

123456789101112131415161718192021222324252627
  1. from django.test.client import RequestFactory
  2. from django.urls import reverse
  3. from fixtures.apidocs_test_case import APIDocsTestCase
  4. class ProjectDetailsDocs(APIDocsTestCase):
  5. def setUp(self):
  6. self.url = reverse(
  7. "sentry-api-0-project-details",
  8. kwargs={"organization_slug": self.organization.slug, "project_slug": self.project.slug},
  9. )
  10. self.login_as(user=self.user)
  11. def test_get(self):
  12. response = self.client.get(self.url)
  13. request = RequestFactory().get(self.url)
  14. self.validate_schema(request, response)
  15. def test_put(self):
  16. data = {"name": "foo"}
  17. response = self.client.put(self.url, data)
  18. request = RequestFactory().put(self.url, data)
  19. self.validate_schema(request, response)