From 45ef6d0461a635a7bdd0afdf998c505ca53ec329 Mon Sep 17 00:00:00 2001 From: Ivana Kellyer Date: Thu, 3 Oct 2024 18:22:43 +0200 Subject: [PATCH] remove asgi tests, will add this to master --- tests/integrations/django/asgi/test_asgi.py | 74 --------------------- 1 file changed, 74 deletions(-) diff --git a/tests/integrations/django/asgi/test_asgi.py b/tests/integrations/django/asgi/test_asgi.py index 3a413ee310..57a6faea44 100644 --- a/tests/integrations/django/asgi/test_asgi.py +++ b/tests/integrations/django/asgi/test_asgi.py @@ -624,77 +624,3 @@ async def test_async_view(sentry_init, capture_events, application): (event,) = events assert event["type"] == "transaction" assert event["transaction"] == "/simple_async_view" - - -@pytest.mark.parametrize("application", APPS) -@pytest.mark.asyncio -async def test_transaction_http_method_default( - sentry_init, capture_events, application -): - """ - By default OPTIONS and HEAD requests do not create a transaction. - """ - sentry_init( - integrations=[ - DjangoIntegration( - middleware_spans=False, - signals_spans=False, - ) - ], - traces_sample_rate=1.0, - ) - events = capture_events() - - comm = HttpCommunicator(application, "GET", "/simple_async_view") - await comm.get_response() - await comm.wait() - - comm = HttpCommunicator(application, "OPTIONS", "/simple_async_view") - await comm.get_response() - await comm.wait() - - comm = HttpCommunicator(application, "HEAD", "/simple_async_view") - await comm.get_response() - await comm.wait() - - (event,) = events - - assert len(events) == 1 - assert event["request"]["method"] == "GET" - - -@pytest.mark.parametrize("application", APPS) -@pytest.mark.asyncio -async def test_transaction_http_method_custom(sentry_init, capture_events, application): - sentry_init( - integrations=[ - DjangoIntegration( - http_methods_to_capture=( - "OPTIONS", - "head", - ), # capitalization does not matter - middleware_spans=False, - signals_spans=False, - ) - ], - traces_sample_rate=1.0, - ) - events = capture_events() - - comm = HttpCommunicator(application, "GET", "/simple_async_view") - await comm.get_response() - await comm.wait() - - comm = HttpCommunicator(application, "OPTIONS", "/simple_async_view") - await comm.get_response() - await comm.wait() - - comm = HttpCommunicator(application, "HEAD", "/simple_async_view") - await comm.get_response() - await comm.wait() - - assert len(events) == 2 - - (event1, event2) = events - assert event1["request"]["method"] == "OPTIONS" - assert event2["request"]["method"] == "HEAD"