File tree Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -86,10 +86,15 @@ def assertCacheWorksForUser(
86
86
result_from_wire ['access_token' ], result_from_cache ['access_token' ],
87
87
"We should get a cached AT" )
88
88
89
- # Going to test acquire_token_silent(...) to obtain an AT by a RT from cache
90
- self .app .token_cache ._cache ["AccessToken" ] = {} # A hacky way to clear ATs
89
+ if "refresh_token" in result_from_wire :
90
+ # Going to test acquire_token_silent(...) to obtain an AT by a RT from cache
91
+ self .app .token_cache ._cache ["AccessToken" ] = {} # A hacky way to clear ATs
91
92
result_from_cache = self .app .acquire_token_silent (
92
93
scope , account = account , data = data or {})
94
+ if "refresh_token" not in result_from_wire :
95
+ self .assertEqual (
96
+ result_from_cache ["access_token" ], result_from_wire ["access_token" ],
97
+ "The previously cached AT should be returned" )
93
98
self .assertIsNotNone (result_from_cache ,
94
99
"We should get a result from acquire_token_silent(...) call" )
95
100
self .assertIsNotNone (
You can’t perform that action at this time.
0 commit comments