|
12 | 12 | from django.utils import timezone
|
13 | 13 |
|
14 | 14 | from sentry import options
|
| 15 | +from sentry.analytics.events.advanced_search_feature_gated import AdvancedSearchFeatureGateEvent |
15 | 16 | from sentry.feedback.usecases.create_feedback import FeedbackCreationSource, create_feedback_issue
|
16 | 17 | from sentry.integrations.models.external_issue import ExternalIssue
|
17 | 18 | from sentry.integrations.models.organization_integration import OrganizationIntegration
|
|
63 | 64 | from sentry.silo.base import SiloMode
|
64 | 65 | from sentry.testutils.cases import APITestCase, SnubaTestCase
|
65 | 66 | from sentry.testutils.helpers import parse_link_header
|
| 67 | +from sentry.testutils.helpers.analytics import assert_last_analytics_event |
66 | 68 | from sentry.testutils.helpers.datetime import before_now
|
67 | 69 | from sentry.testutils.helpers.features import Feature, apply_feature_flag_on_cls, with_feature
|
68 | 70 | from sentry.testutils.helpers.options import override_options
|
@@ -909,11 +911,13 @@ def test_advanced_search_errors(self, mock_record: MagicMock, _: MagicMock) -> N
|
909 | 911 | "search" == response.data["detail"]
|
910 | 912 | )
|
911 | 913 |
|
912 |
| - mock_record.assert_called_with( |
913 |
| - "advanced_search.feature_gated", |
914 |
| - user_id=self.user.id, |
915 |
| - default_user_id=self.user.id, |
916 |
| - organization_id=self.organization.id, |
| 914 | + assert_last_analytics_event( |
| 915 | + mock_record, |
| 916 | + AdvancedSearchFeatureGateEvent( |
| 917 | + user_id=self.user.id, |
| 918 | + default_user_id=self.user.id, |
| 919 | + organization_id=self.organization.id, |
| 920 | + ), |
917 | 921 | )
|
918 | 922 |
|
919 | 923 | # This seems like a random override, but this test needed a way to override
|
@@ -3825,11 +3829,13 @@ def test_snuba_heavy_advanced_search_errors(self, mock_record: MagicMock, _: Mag
|
3825 | 3829 | "search" == response.data["detail"]
|
3826 | 3830 | )
|
3827 | 3831 |
|
3828 |
| - mock_record.assert_called_with( |
3829 |
| - "advanced_search.feature_gated", |
3830 |
| - user_id=self.user.id, |
3831 |
| - default_user_id=self.user.id, |
3832 |
| - organization_id=self.organization.id, |
| 3832 | + assert_last_analytics_event( |
| 3833 | + mock_record, |
| 3834 | + AdvancedSearchFeatureGateEvent( |
| 3835 | + user_id=self.user.id, |
| 3836 | + default_user_id=self.user.id, |
| 3837 | + organization_id=self.organization.id, |
| 3838 | + ), |
3833 | 3839 | )
|
3834 | 3840 |
|
3835 | 3841 | def test_snuba_heavy_filter_not_unresolved(self, _: MagicMock) -> None:
|
|
0 commit comments