@@ -31,21 +31,19 @@ def test_2(self):
31
31
self .assertDictEqual (expected_output , output )
32
32
33
33
def test_3 (self ):
34
- expected_logs = ['INFO:test_3_log:Session {} logout user' .format (self .session_id )]
35
34
expected_output = [components .SuccessLogoutAlert (), components .UserPortalCardBody (None )]
36
35
expected_output = [json .loads (json .dumps (x , cls = plotly .utils .PlotlyJSONEncoder )) for x in expected_output ]
37
36
expected_cache = {b'id' : cache_utils .compress_data (self .session_id )}
38
37
cache_utils .store_fname (self .cache , self .session_id , 'dummy_fname_1' , 'contact' )
39
38
self .cache .hset (self .session_id , 'user' , 'username' )
40
39
self .cache .hset (self .session_id , 'session_pkid' , '123' )
41
40
42
- with self .assertLogs ('test_3_log' , level = 'INFO' ) as log :
43
- test_log = logging .getLogger ('test_3_log' )
44
- output = app_utils .user_logout (self .session_id , self .cache , test_log )
45
- self .assertEqual (output [0 ], no_update )
46
- output = [json .loads (json .dumps (x , cls = plotly .utils .PlotlyJSONEncoder )) for x in output [1 :]]
47
- self .assertListEqual (output , expected_output )
48
- self .assertDictEqual (expected_cache , self .cache .hgetall (self .session_id ))
41
+ test_log = logging .getLogger ('test_3_log' )
42
+ output = app_utils .user_logout (self .session_id , self .cache , test_log )
43
+ self .assertEqual (output [0 ], no_update )
44
+ output = [json .loads (json .dumps (x , cls = plotly .utils .PlotlyJSONEncoder )) for x in output [1 :]]
45
+ self .assertListEqual (output , expected_output )
46
+ self .assertDictEqual (expected_cache , self .cache .hgetall (self .session_id ))
49
47
50
48
51
49
if __name__ == '__main__' :
0 commit comments