88 SentryAppInstallationUpdatedEvent ,
99)
1010from sentry .analytics .events .sentry_app_uninstalled import SentryAppUninstalledEvent
11- from sentry .constants import SentryAppInstallationStatus
11+ from sentry .constants import ObjectStatus , SentryAppInstallationStatus
1212from sentry .deletions .tasks .scheduled import run_scheduled_deletions_control
1313from sentry .models .auditlogentry import AuditLogEntry
14+ from sentry .notifications .models .notificationaction import ActionTarget
1415from sentry .sentry_apps .models .sentry_app_installation import SentryAppInstallation
1516from sentry .sentry_apps .token_exchange .grant_exchanger import GrantExchanger
1617from sentry .testutils .cases import APITestCase
1718from sentry .testutils .helpers .analytics import assert_last_analytics_event
19+ from sentry .testutils .helpers .options import override_options
20+ from sentry .testutils .outbox import outbox_runner
1821from sentry .testutils .silo import control_silo_test
1922from sentry .users .services .user .service import user_service
2023from sentry .utils import json
24+ from sentry .workflow_engine .models .action import Action
25+ from sentry .workflow_engine .typings .notification_action import SentryAppIdentifier
2126
2227
2328class SentryAppInstallationDetailsTest (APITestCase ):
@@ -103,6 +108,7 @@ def test_no_access_outside_install_organization(self) -> None:
103108class DeleteSentryAppInstallationDetailsTest (SentryAppInstallationDetailsTest ):
104109 @responses .activate
105110 @patch ("sentry.analytics.record" )
111+ @override_options ({"workflow_engine.sentry-app-actions-outbox" : True })
106112 def test_delete_install (self , record : MagicMock ) -> None :
107113 responses .add (url = "https://example.com/webhook" , method = responses .POST , body = b"" )
108114 self .login_as (user = self .user )
@@ -122,9 +128,24 @@ def test_delete_install(self, record: MagicMock) -> None:
122128 ),
123129 )
124130
131+ action = self .create_action (
132+ type = Action .Type .SENTRY_APP ,
133+ config = {
134+ "target_identifier" : self .installation2 .uuid ,
135+ "sentry_app_identifier" : SentryAppIdentifier .SENTRY_APP_INSTALLATION_UUID ,
136+ "target_type" : ActionTarget .SENTRY_APP ,
137+ },
138+ )
139+
125140 with self .tasks ():
126141 run_scheduled_deletions_control ()
127142
143+ with outbox_runner ():
144+ pass
145+
146+ action .refresh_from_db ()
147+ assert action .status == ObjectStatus .DISABLED
148+
128149 assert not SentryAppInstallation .objects .filter (id = self .installation2 .id ).exists ()
129150
130151 response_body = json .loads (responses .calls [0 ].request .body )
0 commit comments