Skip to content

Commit 4c38557

Browse files
committed
fix tests
1 parent b6bfb81 commit 4c38557

File tree

1 file changed

+13
-2
lines changed

1 file changed

+13
-2
lines changed

tests/sentry/ingest/ingest_consumer/test_ingest_consumer_processing.py

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717

1818
from sentry import eventstore
1919
from sentry.event_manager import EventManager
20+
from sentry.features import has
2021
from sentry.ingest.consumer.processors import (
2122
process_attachment_chunk,
2223
process_event,
@@ -260,7 +261,10 @@ def test_feedbacks_spawn_save_event_feedback(
260261
@django_db_all
261262
@pytest.mark.parametrize("missing_chunks", (True, False))
262263
def test_with_attachments(default_project, task_runner, missing_chunks, monkeypatch, django_cache):
263-
monkeypatch.setattr("sentry.features.has", lambda *a, **kw: True)
264+
def mock_has(feature_name, *args, **kwargs):
265+
return True if "event-attachments" in feature_name else has(feature_name, *args, **kwargs)
266+
267+
monkeypatch.setattr("sentry.features.has", mock_has)
264268

265269
payload = get_normalized_event({"message": "hello world"}, default_project)
266270
event_id = payload["event_id"]
@@ -427,7 +431,14 @@ def test_deobfuscate_view_hierarchy(default_project, task_runner):
427431
def test_individual_attachments(
428432
default_project, factories, monkeypatch, event_attachments, chunks, with_group, django_cache
429433
):
430-
monkeypatch.setattr("sentry.features.has", lambda *a, **kw: event_attachments)
434+
def mock_has(feature_name, *args, **kwargs):
435+
return (
436+
event_attachments
437+
if "event-attachments" in feature_name
438+
else has(feature_name, *args, **kwargs)
439+
)
440+
441+
monkeypatch.setattr("sentry.features.has", mock_has)
431442

432443
event_id = uuid.uuid4().hex
433444
attachment_id = "ca90fb45-6dd9-40a0-a18f-8693aa621abb"

0 commit comments

Comments
 (0)