Skip to content

Commit

Permalink
move tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Christinarlong committed Sep 20, 2024
1 parent 304b5f3 commit f31fbd3
Show file tree
Hide file tree
Showing 15 changed files with 20 additions and 18 deletions.
12 changes: 0 additions & 12 deletions src/sentry/api/endpoints/integrations/sentry_apps/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,6 @@
from .details import SentryAppDetailsEndpoint
from .features import SentryAppFeaturesEndpoint
from .index import SentryAppsEndpoint
from .installation.details import SentryAppInstallationDetailsEndpoint
from .installation.external_issue.actions import SentryAppInstallationExternalIssueActionsEndpoint
from .installation.external_issue.details import SentryAppInstallationExternalIssueDetailsEndpoint
from .installation.external_issue.index import SentryAppInstallationExternalIssuesEndpoint
from .installation.external_requests import SentryAppInstallationExternalRequestsEndpoint
from .installation.index import SentryAppInstallationsEndpoint
from .interaction import SentryAppInteractionEndpoint
from .internal_app_token.details import SentryInternalAppTokenDetailsEndpoint
from .internal_app_token.index import SentryInternalAppTokensEndpoint
Expand All @@ -26,12 +20,6 @@
"SentryAppComponentsEndpoint",
"SentryAppDetailsEndpoint",
"SentryAppFeaturesEndpoint",
"SentryAppInstallationDetailsEndpoint",
"SentryAppInstallationExternalIssueActionsEndpoint",
"SentryAppInstallationExternalIssueDetailsEndpoint",
"SentryAppInstallationExternalIssuesEndpoint",
"SentryAppInstallationExternalRequestsEndpoint",
"SentryAppInstallationsEndpoint",
"SentryAppInteractionEndpoint",
"SentryAppPublishRequestEndpoint",
"SentryAppRequestsEndpoint",
Expand Down
22 changes: 16 additions & 6 deletions src/sentry/api/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -273,6 +273,22 @@
from sentry.scim.endpoints.members import OrganizationSCIMMemberDetails, OrganizationSCIMMemberIndex
from sentry.scim.endpoints.schemas import OrganizationSCIMSchemaIndex
from sentry.scim.endpoints.teams import OrganizationSCIMTeamDetails, OrganizationSCIMTeamIndex
from sentry.sentry_apps.api.endpoints.installation_details import (
SentryAppInstallationDetailsEndpoint,
)
from sentry.sentry_apps.api.endpoints.installation_external_issue_actions import (
SentryAppInstallationExternalIssueActionsEndpoint,
)
from sentry.sentry_apps.api.endpoints.installation_external_issue_details import (
SentryAppInstallationExternalIssueDetailsEndpoint,
)
from sentry.sentry_apps.api.endpoints.installation_external_issues import (
SentryAppInstallationExternalIssuesEndpoint,
)
from sentry.sentry_apps.api.endpoints.installation_external_requests import (
SentryAppInstallationExternalRequestsEndpoint,
)
from sentry.sentry_apps.api.endpoints.sentry_app_installations import SentryAppInstallationsEndpoint
from sentry.uptime.endpoints.project_uptime_alert_details import ProjectUptimeAlertDetailsEndpoint
from sentry.uptime.endpoints.project_uptime_alert_index import ProjectUptimeAlertIndexEndpoint
from sentry.users.api.endpoints.authenticator_index import AuthenticatorIndexEndpoint
Expand Down Expand Up @@ -368,12 +384,6 @@
SentryAppComponentsEndpoint,
SentryAppDetailsEndpoint,
SentryAppFeaturesEndpoint,
SentryAppInstallationDetailsEndpoint,
SentryAppInstallationExternalIssueActionsEndpoint,
SentryAppInstallationExternalIssueDetailsEndpoint,
SentryAppInstallationExternalIssuesEndpoint,
SentryAppInstallationExternalRequestsEndpoint,
SentryAppInstallationsEndpoint,
SentryAppInteractionEndpoint,
SentryAppPublishRequestEndpoint,
SentryAppRequestsEndpoint,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
from sentry.sentry_apps.installations import SentryAppInstallationCreator
from sentry.sentry_apps.models.sentry_app import SentryApp
from sentry.sentry_apps.models.sentry_app_installation import SentryAppInstallation
from sentry.users.models.user import User


class SentryAppInstallationsSerializer(serializers.Serializer):
Expand Down Expand Up @@ -90,6 +91,9 @@ def post(self, request: Request, organization) -> Response:
sentry_app__slug=slug, organization_id=organization.id
)
except SentryAppInstallation.DoesNotExist:
assert isinstance(
request.user, User
), "user must be authenticated to create a SentryAppInstallation"
install = SentryAppInstallationCreator(
organization_id=organization.id, slug=slug, notify=True
).run(user=request.user, request=request)
Expand Down

0 comments on commit f31fbd3

Please sign in to comment.