test_key_details.py 819 B

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