|
3 | 3 |
|
4 | 4 | from django.utils import timezone
|
5 | 5 |
|
| 6 | +from sentry.analytics.events.issue_resolved import IssueResolvedEvent |
6 | 7 | from sentry.integrations.example.integration import AliasedIntegrationProvider, ExampleIntegration
|
7 | 8 | from sentry.integrations.mixins.issues import IssueSyncIntegration as IssueSyncIntegrationBase
|
8 | 9 | from sentry.integrations.models.external_issue import ExternalIssue
|
|
16 | 17 | from sentry.models.release import Release
|
17 | 18 | from sentry.silo.base import SiloMode
|
18 | 19 | from sentry.testutils.cases import TestCase
|
| 20 | +from sentry.testutils.helpers.analytics import assert_last_analytics_event |
19 | 21 | from sentry.testutils.helpers.features import with_feature
|
20 | 22 | from sentry.testutils.silo import assume_test_silo_mode
|
21 | 23 | from sentry.types.activity import ActivityType
|
@@ -563,16 +565,18 @@ def test_status_sync_inbound_resolve_webhook_and_sends_to_sentry_app(
|
563 | 565 | assert data["data"]["resolution_type"] == self.integration.provider
|
564 | 566 |
|
565 | 567 | # Verify analytics event was recorded
|
566 |
| - mock_record.assert_called_with( |
567 |
| - "issue.resolved", |
568 |
| - project_id=self.group.project.id, |
569 |
| - default_user_id="Sentry Jira", |
570 |
| - organization_id=self.group.organization.id, |
571 |
| - group_id=self.group.id, |
572 |
| - resolution_type="with_third_party_app", |
573 |
| - provider="example", |
574 |
| - issue_type=self.group.issue_type.slug, |
575 |
| - issue_category=self.group.issue_category.name.lower(), |
| 568 | + assert_last_analytics_event( |
| 569 | + mock_record, |
| 570 | + IssueResolvedEvent( |
| 571 | + project_id=self.group.project.id, |
| 572 | + default_user_id="Sentry Jira", |
| 573 | + organization_id=self.group.organization.id, |
| 574 | + group_id=self.group.id, |
| 575 | + resolution_type="with_third_party_app", |
| 576 | + provider="example", |
| 577 | + issue_type=self.group.issue_type.slug, |
| 578 | + issue_category=self.group.issue_category.name.lower(), |
| 579 | + ), |
576 | 580 | )
|
577 | 581 |
|
578 | 582 | @patch("sentry.utils.sentry_apps.webhooks.safe_urlopen", return_value=MockResponseInstance)
|
|
0 commit comments