Skip to content

Commit ba5e90b

Browse files
committed
Proof-of-Concept: Removing hardcoded offline_access
1 parent 0b84f5e commit ba5e90b

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

tests/test_e2e.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff 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(

0 commit comments

Comments
 (0)