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(
8686 result_from_wire ['access_token' ], result_from_cache ['access_token' ],
8787 "We should get a cached AT" )
8888
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
9192 result_from_cache = self .app .acquire_token_silent (
9293 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" )
9398 self .assertIsNotNone (result_from_cache ,
9499 "We should get a result from acquire_token_silent(...) call" )
95100 self .assertIsNotNone (
You can’t perform that action at this time.
0 commit comments