class SentryAppInstallationBaseEndpointTest(TestCase):
    def setUp(self):
        self.endpoint = SentryAppInstallationBaseEndpoint()

        self.user = self.create_user()
        self.org = self.create_organization(owner=self.user)

        self.request = self.make_request(user=self.user, method='GET')

        self.sentry_app = self.create_sentry_app(
            name='foo',
            organization=self.org,
        )

        self.installation = SentryAppInstallationCreator.run(
            slug=self.sentry_app.slug,
            organization=self.org,
            user=self.user,
        )

    def test_retrieves_installation(self):
        args, kwargs = self.endpoint.convert_args(self.request, self.installation.uuid)
        assert kwargs['installation'] == self.installation

    def test_raises_when_sentry_app_not_found(self):
        with self.assertRaises(Http404):
            self.endpoint.convert_args(self.request, '1234')
Exemple #2
0
class SentryAppInstallationBaseEndpointTest(TestCase):
    def setUp(self):
        self.endpoint = SentryAppInstallationBaseEndpoint()

        self.user = self.create_user()
        self.org = self.create_organization(owner=self.user)

        self.request = self.make_request(user=self.user, method='GET')

        self.sentry_app = self.create_sentry_app(
            name='foo',
            organization=self.org,
        )

        self.installation = sentry_app_installations.Creator.run(
            slug=self.sentry_app.slug,
            organization=self.org,
            user=self.user,
        )

    def test_retrieves_installation(self):
        args, kwargs = self.endpoint.convert_args(self.request, self.installation.uuid)
        assert kwargs['installation'] == self.installation

    def test_raises_when_sentry_app_not_found(self):
        with self.assertRaises(Http404):
            self.endpoint.convert_args(self.request, '1234')
Exemple #3
0
    def setUp(self):
        self.endpoint = SentryAppInstallationBaseEndpoint()

        self.user = self.create_user()
        self.org = self.create_organization(owner=self.user)

        self.request = self.make_request(user=self.user, method="GET")

        self.sentry_app = self.create_sentry_app(name="foo",
                                                 organization=self.org)

        self.installation = self.create_sentry_app_installation(
            slug=self.sentry_app.slug, organization=self.org, user=self.user)
Exemple #4
0
    def setUp(self):
        self.endpoint = SentryAppInstallationBaseEndpoint()

        self.user = self.create_user()
        self.org = self.create_organization(owner=self.user)

        self.request = self.make_request(user=self.user, method='GET')

        self.sentry_app = self.create_sentry_app(
            name='foo',
            organization=self.org,
        )

        self.installation, _ = SentryAppInstallationCreator.run(
            slug=self.sentry_app.slug,
            organization=self.org,
        )
Exemple #5
0
    def setUp(self):
        self.endpoint = SentryAppInstallationBaseEndpoint()

        self.user = self.create_user()
        self.org = self.create_organization(owner=self.user)

        self.request = self.make_request(user=self.user, method='GET')

        self.sentry_app = self.create_sentry_app(
            name='foo',
            organization=self.org,
        )

        self.installation = sentry_app_installations.Creator.run(
            slug=self.sentry_app.slug,
            organization=self.org,
            user=self.user,
        )