test_key_details.py 750 B

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