|
14 | 14 | from werkzeug.test import Client |
15 | 15 |
|
16 | 16 | from sentry_sdk import start_transaction |
17 | | -from sentry_sdk.consts import SPANDATA, DBOPERATION |
| 17 | +from sentry_sdk.consts import SPANDATA, SPANNAME |
18 | 18 | from sentry_sdk.integrations.django import DjangoIntegration |
19 | 19 |
|
20 | 20 | from tests.integrations.django.utils import pytest_mark_django_db_decorator |
@@ -97,7 +97,7 @@ def test_db_transaction_spans_disabled_no_autocommit( |
97 | 97 | commit_spans = [ |
98 | 98 | span |
99 | 99 | for span in itertools.chain(postgres_spans["spans"], sqlite_spans["spans"]) |
100 | | - if span["data"].get(SPANDATA.DB_OPERATION) == DBOPERATION.COMMIT |
| 100 | + if span["data"].get(SPANDATA.DB_OPERATION) == SPANNAME.COMMIT |
101 | 101 | ] |
102 | 102 | assert len(commit_spans) == 0 |
103 | 103 |
|
@@ -168,7 +168,7 @@ def test_db_transaction_spans_disabled_atomic(sentry_init, client, capture_event |
168 | 168 | commit_spans = [ |
169 | 169 | span |
170 | 170 | for span in itertools.chain(postgres_spans["spans"], sqlite_spans["spans"]) |
171 | | - if span["data"].get(SPANDATA.DB_OPERATION) == DBOPERATION.COMMIT |
| 171 | + if span["data"].get(SPANDATA.DB_OPERATION) == SPANNAME.COMMIT |
172 | 172 | ] |
173 | 173 | assert len(commit_spans) == 0 |
174 | 174 |
|
@@ -201,7 +201,7 @@ def test_db_no_autocommit_execute(sentry_init, client, capture_events): |
201 | 201 | commit_spans = [ |
202 | 202 | span |
203 | 203 | for span in event["spans"] |
204 | | - if span["data"].get(SPANDATA.DB_OPERATION) == DBOPERATION.COMMIT |
| 204 | + if span["data"].get(SPANDATA.DB_OPERATION) == SPANNAME.COMMIT |
205 | 205 | ] |
206 | 206 | assert len(commit_spans) == 1 |
207 | 207 | commit_span = commit_spans[0] |
@@ -292,7 +292,7 @@ def test_db_no_autocommit_executemany(sentry_init, client, capture_events): |
292 | 292 | commit_spans = [ |
293 | 293 | span |
294 | 294 | for span in event["spans"] |
295 | | - if span["data"].get(SPANDATA.DB_OPERATION) == DBOPERATION.COMMIT |
| 295 | + if span["data"].get(SPANDATA.DB_OPERATION) == SPANNAME.COMMIT |
296 | 296 | ] |
297 | 297 | assert len(commit_spans) == 1 |
298 | 298 | commit_span = commit_spans[0] |
@@ -343,7 +343,7 @@ def test_db_atomic_execute(sentry_init, client, capture_events): |
343 | 343 | commit_spans = [ |
344 | 344 | span |
345 | 345 | for span in event["spans"] |
346 | | - if span["data"].get(SPANDATA.DB_OPERATION) == DBOPERATION.COMMIT |
| 346 | + if span["data"].get(SPANDATA.DB_OPERATION) == SPANNAME.COMMIT |
347 | 347 | ] |
348 | 348 | assert len(commit_spans) == 1 |
349 | 349 | commit_span = commit_spans[0] |
@@ -431,7 +431,7 @@ def test_db_atomic_executemany(sentry_init, client, capture_events): |
431 | 431 | commit_spans = [ |
432 | 432 | span |
433 | 433 | for span in event["spans"] |
434 | | - if span["data"].get(SPANDATA.DB_OPERATION) == DBOPERATION.COMMIT |
| 434 | + if span["data"].get(SPANDATA.DB_OPERATION) == SPANNAME.COMMIT |
435 | 435 | ] |
436 | 436 | assert len(commit_spans) == 1 |
437 | 437 | commit_span = commit_spans[0] |
|
0 commit comments