@@ -40,7 +40,7 @@ def test_transactions(sentry_init, capture_events, mongo_server, with_pii):
4040 ) # force query execution
4141 connection ["test_db" ]["test_collection" ].insert_one ({"foo" : 2 })
4242 try :
43- connection ["test_db" ]["erroneous" ].insert_many ([{"bar" : 3 }, {"baz" : 3 }])
43+ connection ["test_db" ]["erroneous" ].insert_many ([{"bar" : 3 }, {"baz" : 4 }])
4444 pytest .fail ("Request should raise" )
4545 except Exception :
4646 pass
@@ -70,19 +70,17 @@ def test_transactions(sentry_init, capture_events, mongo_server, with_pii):
7070 assert insert_success ["description" ].startswith ("insert {" )
7171 assert insert_fail ["description" ].startswith ("insert {" )
7272 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" ]
7976 else :
77+ # All values in filter replaced by "%s"
78+ assert "1" not in find ["description" ]
8079 # 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" ]
8381 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" ]
8684 )
8785
8886 assert find ["tags" ]["status" ] == "ok"
@@ -112,9 +110,9 @@ def test_breadcrumbs(sentry_init, capture_events, mongo_server, with_pii):
112110 assert crumb ["category" ] == "query"
113111 assert crumb ["message" ].startswith ("find {" )
114112 if with_pii :
115- assert "'foobar' " in crumb ["message" ]
113+ assert "1 " in crumb ["message" ]
116114 else :
117- assert "'foobar' " not in crumb ["message" ]
115+ assert "1 " not in crumb ["message" ]
118116 assert crumb ["type" ] == "db.query"
119117 assert crumb ["data" ] == {
120118 "db.name" : "test_db" ,
0 commit comments