@@ -159,7 +159,7 @@ def test_get_access_token(self):
159
159
url = ('/oauth/token?grant_type=password&state=foo'
160
160
'&scope=email+address&username=admin&password=admin' )
161
161
rv = self .client .get (url , headers = {
162
- 'HTTP_AUTHORIZATION ' : 'Basic %s' % auth_code ,
162
+ 'Authorization ' : 'Basic %s' % auth_code ,
163
163
}, data = {'confirm' : 'yes' })
164
164
assert b'access_token' in rv .data
165
165
assert b'state' in rv .data
@@ -168,7 +168,7 @@ def test_invalid_user_credentials(self):
168
168
url = ('/oauth/token?grant_type=password&state=foo'
169
169
'&scope=email+address&username=fake&password=admin' )
170
170
rv = self .client .get (url , headers = {
171
- 'HTTP_AUTHORIZATION ' : 'Basic %s' % auth_code ,
171
+ 'Authorization ' : 'Basic %s' % auth_code ,
172
172
}, data = {'confirm' : 'yes' })
173
173
174
174
assert b'Invalid credentials given' in rv .data
@@ -195,7 +195,7 @@ def test_refresh_token_in_password_grant(self):
195
195
url = ('/oauth/token?grant_type=password'
196
196
'&scope=email+address&username=admin&password=admin' )
197
197
rv = self .client .get (url , headers = {
198
- 'HTTP_AUTHORIZATION ' : 'Basic %s' % auth_code ,
198
+ 'Authorization ' : 'Basic %s' % auth_code ,
199
199
})
200
200
assert b'access_token' in rv .data
201
201
data = json .loads (u (rv .data ))
@@ -206,7 +206,7 @@ def test_refresh_token_in_password_grant(self):
206
206
'&scope=%s&refresh_token=%s&username=admin' )
207
207
url = url % args
208
208
rv = self .client .get (url , headers = {
209
- 'HTTP_AUTHORIZATION ' : 'Basic %s' % auth_code ,
209
+ 'Authorization ' : 'Basic %s' % auth_code ,
210
210
})
211
211
assert b'access_token' in rv .data
212
212
@@ -232,15 +232,15 @@ def test_get_access_token(self):
232
232
url = ('/oauth/token?grant_type=client_credentials'
233
233
'&scope=email+address&username=admin&password=admin' )
234
234
rv = self .client .get (url , headers = {
235
- 'HTTP_AUTHORIZATION ' : 'Basic %s' % auth_code ,
235
+ 'Authorization ' : 'Basic %s' % auth_code ,
236
236
}, data = {'confirm' : 'yes' })
237
237
assert b'access_token' in rv .data
238
238
239
239
def test_invalid_auth_header (self ):
240
240
url = ('/oauth/token?grant_type=client_credentials'
241
241
'&scope=email+address&username=admin&password=admin' )
242
242
rv = self .client .get (url , headers = {
243
- 'HTTP_AUTHORIZATION ' : 'Basic foobar'
243
+ 'Authorization ' : 'Basic foobar'
244
244
}, data = {'confirm' : 'yes' })
245
245
assert b'invalid_client' in rv .data
246
246
@@ -249,7 +249,7 @@ def test_no_client(self):
249
249
url = ('/oauth/token?grant_type=client_credentials'
250
250
'&scope=email+address&username=admin&password=admin' )
251
251
rv = self .client .get (url , headers = {
252
- 'HTTP_AUTHORIZATION ' : 'Basic %s' % auth_code ,
252
+ 'Authorization ' : 'Basic %s' % auth_code ,
253
253
}, data = {'confirm' : 'yes' })
254
254
assert b'invalid_client' in rv .data
255
255
@@ -258,7 +258,7 @@ def test_wrong_secret_client(self):
258
258
url = ('/oauth/token?grant_type=client_credentials'
259
259
'&scope=email+address&username=admin&password=admin' )
260
260
rv = self .client .get (url , headers = {
261
- 'HTTP_AUTHORIZATION ' : 'Basic %s' % auth_code ,
261
+ 'Authorization ' : 'Basic %s' % auth_code ,
262
262
}, data = {'confirm' : 'yes' })
263
263
assert b'invalid_client' in rv .data
264
264
0 commit comments