Exemple #1
0
    def setUp(self):
        self.endpoint = SentryAppBaseEndpoint()

        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)
Exemple #2
0
class SentryAppBaseEndpointTest(TestCase):
    def setUp(self):
        self.endpoint = SentryAppBaseEndpoint()

        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)

    def test_retrieves_sentry_app(self):
        args, kwargs = self.endpoint.convert_args(self.request, self.sentry_app.slug)
        assert kwargs["sentry_app"] == self.sentry_app

    def test_raises_when_sentry_app_not_found(self):
        with self.assertRaises(Http404):
            self.endpoint.convert_args(self.request, "notanapp")
Exemple #3
0
    def setUp(self):
        self.endpoint = SentryAppBaseEndpoint()

        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,
        )
Exemple #4
0
class SentryAppBaseEndpointTest(TestCase):
    def setUp(self):
        self.endpoint = SentryAppBaseEndpoint()

        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,
        )

    def test_retrieves_sentry_app(self):
        args, kwargs = self.endpoint.convert_args(self.request, self.sentry_app.slug)
        assert kwargs['sentry_app'] == self.sentry_app

    def test_raises_when_sentry_app_not_found(self):
        with self.assertRaises(Http404):
            self.endpoint.convert_args(self.request, 'notanapp')