Skip to content

Commit c9847a3

Browse files
committed
Update the test to create a mock workflow event data that will throw instead of manipulating a frozen dataset
1 parent ceb3f1e commit c9847a3

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

tests/sentry/notifications/notification_action/test_metric_alert_registry_handlers.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@
88
import pytest
99
from django.utils import timezone
1010

11+
from sentry.db.models import NodeData
12+
from sentry.eventstore.models import GroupEvent
1113
from sentry.incidents.grouptype import MetricIssue, MetricIssueEvidenceData
1214
from sentry.incidents.models.alert_rule import (
1315
AlertRuleDetectionType,
@@ -267,7 +269,10 @@ def setUp(self):
267269
self.handler = TestHandler()
268270

269271
def test_missing_occurrence_raises_value_error(self):
270-
self.event_data.event._occurrence = None
272+
self.event_data = WorkflowEventData(
273+
event=GroupEvent(self.project.id, "test", self.group, NodeData("test-id")),
274+
group=self.group,
275+
)
271276

272277
with pytest.raises(ValueError):
273278
self.handler.invoke_legacy_registry(self.event_data, self.action, self.detector)

0 commit comments

Comments
 (0)