test_project_issues.py 1.0 KB

12345678910111213141516171819202122232425262728293031323334
  1. from django.test.client import RequestFactory
  2. from fixtures.apidocs_test_case import APIDocsTestCase
  3. from sentry.testutils.silo import region_silo_test
  4. @region_silo_test(stable=True)
  5. class ProjectIssuesDocs(APIDocsTestCase):
  6. def setUp(self):
  7. self.create_event("a")
  8. self.create_event("b")
  9. self.url = f"/api/0/projects/{self.project.organization.slug}/{self.project.slug}/issues/"
  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 = {"isPublic": False, "status": "unresolved", "statusDetails": {}}
  17. response = self.client.put(self.url, data)
  18. request = RequestFactory().put(self.url, data)
  19. self.validate_schema(request, response)
  20. def test_delete(self):
  21. response = self.client.delete(self.url)
  22. request = RequestFactory().delete(self.url)
  23. self.validate_schema(request, response)