File tree Expand file tree Collapse file tree 1 file changed +16
-0
lines changed
Expand file tree Collapse file tree 1 file changed +16
-0
lines changed Original file line number Diff line number Diff line change @@ -247,6 +247,22 @@ def test_load_application_overwrites_client_on_client_id_mismatch(self):
247247 self .assertEqual (self .request .client , self .application )
248248 another_application .delete ()
249249
250+ @mock .patch .object (Application , "is_usable" )
251+ def test_load_application_returns_none_when_client_not_usable_cached (self , mock_is_usable ):
252+ mock_is_usable .return_value = False
253+ self .request .client = self .application
254+ application = self .validator ._load_application ("client_id" , self .request )
255+ self .assertIsNone (application )
256+ self .assertIsNone (self .request .client )
257+
258+ @mock .patch .object (Application , "is_usable" )
259+ def test_load_application_returns_none_when_client_not_usable_db_lookup (self , mock_is_usable ):
260+ mock_is_usable .return_value = False
261+ self .request .client = None
262+ application = self .validator ._load_application ("client_id" , self .request )
263+ self .assertIsNone (application )
264+ self .assertIsNone (self .request .client )
265+
250266 def test_rotate_refresh_token__is_true (self ):
251267 self .assertTrue (self .validator .rotate_refresh_token (mock .MagicMock ()))
252268
You can’t perform that action at this time.
0 commit comments