@@ -484,9 +484,9 @@ def test_auto_flush_logs_after_100(sentry_init, capture_envelopes):
484
484
raise AssertionError ("200 logs were never flushed after five seconds" )
485
485
486
486
487
- def test_user_attributes (sentry_init , capture_envelopes ):
488
- """User attributes are sent if send_default_pii is True."""
489
- sentry_init (send_default_pii = True , _experiments = {"enable_logs" : True })
487
+ def test_log_user_attributes (sentry_init , capture_envelopes ):
488
+ """User attributes are sent if enable_logs is True."""
489
+ sentry_init (_experiments = {"enable_logs" : True })
490
490
491
491
sentry_sdk .
set_user ({
"id" :
"1" ,
"email" :
"[email protected] " ,
"username" :
"test" })
492
492
envelopes = capture_envelopes ()
@@ -507,26 +507,6 @@ def test_user_attributes(sentry_init, capture_envelopes):
507
507
}
508
508
509
509
510
- def test_user_attributes_no_pii (sentry_init , capture_envelopes ):
511
- """Ensure no user attributes are sent if send_default_pii is False."""
512
- sentry_init (_experiments = {"enable_logs" : True })
513
-
514
- sentry_sdk .
set_user ({
"id" :
"1" ,
"email" :
"[email protected] " ,
"username" :
"test" })
515
- envelopes = capture_envelopes ()
516
-
517
- python_logger = logging .Logger ("test-logger" )
518
- python_logger .warning ("Hello, world!" )
519
-
520
- get_client ().flush ()
521
-
522
- logs = envelopes_to_logs (envelopes )
523
-
524
- (log ,) = logs
525
- assert "user.id" not in log ["attributes" ]
526
- assert "user.email" not in log ["attributes" ]
527
- assert "user.name" not in log ["attributes" ]
528
-
529
-
530
510
@minimum_python_37
531
511
def test_auto_flush_logs_after_5s (sentry_init , capture_envelopes ):
532
512
"""
0 commit comments