File tree Expand file tree Collapse file tree
tests/integrations/django Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -2449,19 +2449,18 @@ def test_transaction_http_method_custom(
24492449
24502450 client .get ("/nomessage" )
24512451 client .options ("/nomessage" )
2452- client .head ("/nomessage" )
24532452
24542453 sentry_sdk .flush ()
24552454 spans = [item .payload for item in items ]
24562455
2457- http_methods = [
2458- span ["attributes" ][SPANDATA .HTTP_REQUEST_METHOD ]
2459- for span in spans
2460- if span .get ("parent_span_id" ) is None
2461- ]
2456+ assert spans [2 ]["attributes" ][SPANDATA .HTTP_REQUEST_METHOD ] == "OPTIONS"
2457+
2458+ client .head ("/nomessage" )
2459+
2460+ sentry_sdk .flush ()
2461+ spans = [item .payload for item in items ]
24622462
2463- assert "OPTIONS" in http_methods
2464- assert "HEAD" in http_methods
2463+ assert spans [5 ]["attributes" ][SPANDATA .HTTP_REQUEST_METHOD ] == "HEAD"
24652464 else :
24662465 events = capture_events ()
24672466
Original file line number Diff line number Diff line change @@ -246,7 +246,6 @@ def test_cache_spans_middleware(
246246 if span_streaming :
247247 items = capture_items ("span" )
248248
249- client .get (reverse ("not_cached_view" ))
250249 client .get (reverse ("not_cached_view" ))
251250
252251 sentry_sdk .flush ()
@@ -269,6 +268,11 @@ def test_cache_spans_middleware(
269268 )
270269 assert "cache.hit" not in spans [1 ]["attributes" ]
271270 assert spans [1 ]["attributes" ]["cache.item_size" ] == 2
271+
272+ client .get (reverse ("not_cached_view" ))
273+
274+ sentry_sdk .flush ()
275+ spans = [item .payload for item in items ]
272276 # second_event - cache.get
273277 assert spans [4 ]["attributes" ]["sentry.op" ] == "cache.get"
274278 assert spans [4 ]["name" ].startswith ("views.decorators.cache.cache_header." )
You can’t perform that action at this time.
0 commit comments