@@ -41,8 +41,8 @@ def tearDown(self):
41
41
self .dev_user .delete ()
42
42
43
43
44
- class TestClientCredentialTokenView (BaseTest ):
45
- def test_client_credential (self ):
44
+ class TestClientCredential (BaseTest ):
45
+ def test_client_credential_access_allowed (self ):
46
46
"""
47
47
Request an access token using Client Credential Flow
48
48
"""
@@ -53,16 +53,6 @@ def test_client_credential(self):
53
53
54
54
response = self .client .post (reverse ('token' ), data = token_request_data , ** auth_headers )
55
55
self .assertEqual (response .status_code , 200 )
56
-
57
-
58
- class TestClientCredentialProtectedResource (BaseTest ):
59
- def test_client_credential_access_allowed (self ):
60
- token_request_data = {
61
- 'grant_type' : 'client_credentials' ,
62
- }
63
- auth_headers = self .get_basic_auth_header (self .application .client_id , self .application .client_secret )
64
-
65
- response = self .client .post (reverse ('token' ), data = token_request_data , ** auth_headers )
66
56
content = json .loads (response .content .decode ("utf-8" ))
67
57
access_token = content ['access_token' ]
68
58
@@ -75,4 +65,4 @@ def test_client_credential_access_allowed(self):
75
65
76
66
view = ResourceView .as_view ()
77
67
response = view (request )
78
- self .assertEqual (response , "This is a protected resource" )
68
+ self .assertEqual (response , "This is a protected resource" )
0 commit comments