test_project_issues.py 973 B

1234567891011121314151617181920212223242526272829303132
  1. from django.test.client import RequestFactory
  2. from fixtures.apidocs_test_case import APIDocsTestCase
  3. class ProjectIssuesDocs(APIDocsTestCase):
  4. def setUp(self):
  5. self.create_event("a")
  6. self.create_event("b")
  7. self.url = f"/api/0/projects/{self.project.organization.slug}/{self.project.slug}/issues/"
  8. self.login_as(user=self.user)
  9. def test_get(self):
  10. response = self.client.get(self.url)
  11. request = RequestFactory().get(self.url)
  12. self.validate_schema(request, response)
  13. def test_put(self):
  14. data = {"isPublic": False, "status": "unresolved", "statusDetails": {}}
  15. response = self.client.put(self.url, data)
  16. request = RequestFactory().put(self.url, data)
  17. self.validate_schema(request, response)
  18. def test_delete(self):
  19. response = self.client.delete(self.url)
  20. request = RequestFactory().delete(self.url)
  21. self.validate_schema(request, response)