1234567891011121314151617181920212223242526272829303132333435 |
- from django.core.urlresolvers import reverse
- from django.test.client import RequestFactory
- from sentry.models import SentryAppInstallation
- from tests.apidocs.util import APIDocsTestCase
- class SentryAppDocs(APIDocsTestCase):
- def setUp(self):
- self.org = self.create_organization(owner=self.user, name="Rowdy Tiger")
- self.project = self.create_project(organization=self.org)
- self.group = self.create_group(project=self.project)
- self.sentry_app = self.create_sentry_app(
- name="Hellboy App", published=True, organization=self.org
- )
- self.install = SentryAppInstallation(sentry_app=self.sentry_app, organization=self.org)
- self.install.save()
- self.url = reverse(
- "sentry-api-0-sentry-app-installation-external-issues",
- kwargs={"uuid": self.install.uuid},
- )
- self.login_as(user=self.user)
- def test_post(self):
- data = {
- "issueId": self.group.id,
- "webUrl": "https://somerandom.io/project/issue-id",
- "project": "ExternalProj",
- "identifier": "issue-1",
- }
- response = self.client.post(self.url, data)
- request = RequestFactory().post(self.url, data)
- self.validate_schema(request, response)
|