File tree Expand file tree Collapse file tree 1 file changed +24
-0
lines changed Expand file tree Collapse file tree 1 file changed +24
-0
lines changed Original file line number Diff line number Diff line change @@ -60,6 +60,30 @@ def test_revoke_access_token(self):
6060 self .assertEqual (response .content , b'' )
6161 self .assertFalse (AccessToken .objects .filter (id = tok .id ).exists ())
6262
63+ def test_revoke_access_token_public (self ):
64+ public_app = Application (
65+ name = "Test Application" ,
66+ redirect_uris = "http://localhost http://example.com http://example.it" ,
67+ user = self .dev_user ,
68+ client_type = Application .CLIENT_PUBLIC ,
69+ authorization_grant_type = Application .GRANT_AUTHORIZATION_CODE ,
70+ )
71+ public_app .save ()
72+
73+ tok = AccessToken .objects .create (user = self .test_user , token = '1234567890' ,
74+ application = public_app ,
75+ expires = timezone .now () + datetime .timedelta (days = 1 ),
76+ scope = 'read write' )
77+
78+ query_string = urlencode ({
79+ 'client_id' : public_app .client_id ,
80+ 'token' : tok .token ,
81+ })
82+
83+ url = "{url}?{qs}" .format (url = reverse ('oauth2_provider:revoke-token' ), qs = query_string )
84+ response = self .client .post (url )
85+ self .assertEqual (response .status_code , 200 )
86+
6387 def test_revoke_access_token_with_hint (self ):
6488 """
6589
You can’t perform that action at this time.
0 commit comments