File tree 1 file changed +11
-4
lines changed
tests/integrations/django
1 file changed +11
-4
lines changed Original file line number Diff line number Diff line change @@ -164,8 +164,12 @@ def test_management_command_raises():
164
164
165
165
166
166
@pytest .mark .django_db
167
- def test_sql_queries (sentry_init , capture_events ):
168
- sentry_init (integrations = [DjangoIntegration ()], send_default_pii = True )
167
+ @pytest .mark .parametrize ("with_integration" , [True , False ])
168
+ def test_sql_queries (sentry_init , capture_events , with_integration ):
169
+ sentry_init (
170
+ integrations = [DjangoIntegration ()] if with_integration else [],
171
+ send_default_pii = True ,
172
+ )
169
173
from django .db import connection
170
174
171
175
sql = connection .cursor ()
@@ -179,9 +183,12 @@ def test_sql_queries(sentry_init, capture_events):
179
183
180
184
event , = events
181
185
182
- crumb = event ["breadcrumbs" ][- 1 ]
186
+ if with_integration :
187
+ crumb = event ["breadcrumbs" ][- 1 ]
183
188
184
- assert crumb ["message" ] == """SELECT count(*) FROM people_person WHERE foo = 123"""
189
+ assert (
190
+ crumb ["message" ] == """SELECT count(*) FROM people_person WHERE foo = 123"""
191
+ )
185
192
186
193
187
194
@pytest .mark .django_db
You can’t perform that action at this time.
0 commit comments