1+ from __future__ import absolute_import
2+
13import pytest
24import json
35
@@ -81,6 +83,7 @@ def test_transaction_with_class_view(sentry_init, client, capture_events):
8183 assert event ["message" ] == "hi"
8284
8385
86+ @pytest .mark .forked
8487@pytest .mark .django_db
8588def test_user_captured (sentry_init , client , capture_events ):
8689 sentry_init (integrations = [DjangoIntegration ()], send_default_pii = True )
@@ -102,6 +105,7 @@ def test_user_captured(sentry_init, client, capture_events):
102105 }
103106
104107
108+ @pytest .mark .forked
105109@pytest .mark .django_db
106110def test_queryset_repr (sentry_init , capture_events ):
107111 sentry_init (integrations = [DjangoIntegration ()])
@@ -156,6 +160,7 @@ def test_500(sentry_init, client, capture_events):
156160 assert content == "Sentry error: %s" % event_id
157161
158162
163+ @pytest .mark .forked
159164def test_management_command_raises ():
160165 # This just checks for our assumption that Django passes through all
161166 # exceptions by default, so our excepthook can be used for management
@@ -164,6 +169,7 @@ def test_management_command_raises():
164169 execute_from_command_line (["manage.py" , "mycrash" ])
165170
166171
172+ @pytest .mark .forked
167173@pytest .mark .django_db
168174@pytest .mark .parametrize ("with_integration" , [True , False ])
169175def test_sql_queries (sentry_init , capture_events , with_integration ):
@@ -175,9 +181,16 @@ def test_sql_queries(sentry_init, capture_events, with_integration):
175181
176182 from django .db import connection
177183
178- sql = connection .cursor ()
184+ sentry_init (
185+ integrations = [DjangoIntegration ()],
186+ send_default_pii = True ,
187+ _experiments = {"record_sql_params" : True },
188+ )
179189
180190 events = capture_events ()
191+
192+ sql = connection .cursor ()
193+
181194 with pytest .raises (OperationalError ):
182195 # table doesn't even exist
183196 sql .execute ("""SELECT count(*) FROM people_person WHERE foo = %s""" , [123 ])
@@ -193,6 +206,7 @@ def test_sql_queries(sentry_init, capture_events, with_integration):
193206 assert crumb ["data" ]["db.params" ] == [123 ]
194207
195208
209+ @pytest .mark .forked
196210@pytest .mark .django_db
197211def test_sql_dict_query_params (sentry_init , capture_events ):
198212 sentry_init (
@@ -234,6 +248,7 @@ def test_sql_dict_query_params(sentry_init, capture_events):
234248 lambda sql : sql .SQL ('SELECT %(my_param)s FROM "foobar"' ),
235249 ],
236250)
251+ @pytest .mark .forked
237252@pytest .mark .django_db
238253def test_sql_psycopg2_string_composition (sentry_init , capture_events , query ):
239254 sentry_init (
@@ -262,6 +277,7 @@ def test_sql_psycopg2_string_composition(sentry_init, capture_events, query):
262277 assert crumb ["data" ]["db.params" ] == {"my_param" : 10 }
263278
264279
280+ @pytest .mark .forked
265281@pytest .mark .django_db
266282def test_sql_psycopg2_placeholders (sentry_init , capture_events ):
267283 sentry_init (
0 commit comments