@@ -40,7 +40,7 @@ def test_transactions(sentry_init, capture_events, mongo_server, with_pii):
40
40
) # force query execution
41
41
connection ["test_db" ]["test_collection" ].insert_one ({"foo" : 2 })
42
42
try :
43
- connection ["test_db" ]["erroneous" ].insert_many ([{"bar" : 3 }, {"baz" : 3 }])
43
+ connection ["test_db" ]["erroneous" ].insert_many ([{"bar" : 3 }, {"baz" : 4 }])
44
44
pytest .fail ("Request should raise" )
45
45
except Exception :
46
46
pass
@@ -70,19 +70,17 @@ def test_transactions(sentry_init, capture_events, mongo_server, with_pii):
70
70
assert insert_success ["description" ].startswith ("insert {" )
71
71
assert insert_fail ["description" ].startswith ("insert {" )
72
72
if with_pii :
73
- assert "'foobar'" in find ["description" ]
74
- assert "'foo'" in insert_success ["description" ]
75
- assert (
76
- "'bar'" in insert_fail ["description" ]
77
- and "'baz'" in insert_fail ["description" ]
78
- )
73
+ assert "1" in find ["description" ]
74
+ assert "2" in insert_success ["description" ]
75
+ assert "3" in insert_fail ["description" ] and "4" in insert_fail ["description" ]
79
76
else :
77
+ # All values in filter replaced by "%s"
78
+ assert "1" not in find ["description" ]
80
79
# All keys below top level replaced by "%s"
81
- assert "'foobar'" not in find ["description" ]
82
- assert "'foo'" not in insert_success ["description" ]
80
+ assert "2" not in insert_success ["description" ]
83
81
assert (
84
- "'bar' " not in insert_fail ["description" ]
85
- and "'baz' " not in insert_fail ["description" ]
82
+ "3 " not in insert_fail ["description" ]
83
+ and "4 " not in insert_fail ["description" ]
86
84
)
87
85
88
86
assert find ["tags" ]["status" ] == "ok"
@@ -112,9 +110,9 @@ def test_breadcrumbs(sentry_init, capture_events, mongo_server, with_pii):
112
110
assert crumb ["category" ] == "query"
113
111
assert crumb ["message" ].startswith ("find {" )
114
112
if with_pii :
115
- assert "'foobar' " in crumb ["message" ]
113
+ assert "1 " in crumb ["message" ]
116
114
else :
117
- assert "'foobar' " not in crumb ["message" ]
115
+ assert "1 " not in crumb ["message" ]
118
116
assert crumb ["type" ] == "db.query"
119
117
assert crumb ["data" ] == {
120
118
"db.name" : "test_db" ,
0 commit comments