Skip to content

Commit 334f54f

Browse files
committed
Updated existing tests to use singular scope parameter.
1 parent d612e54 commit 334f54f

File tree

3 files changed

+18
-18
lines changed

3 files changed

+18
-18
lines changed

oauth2_provider/tests/test_authorization_code.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ def test_pre_auth_valid_client(self):
8989
form = response.context["form"]
9090
self.assertEqual(form['redirect_uri'].value(), "http://example.it")
9191
self.assertEqual(form['state'].value(), "random_state_string")
92-
self.assertEqual(form['scopes'].value(), "read write")
92+
self.assertEqual(form['scope'].value(), "read write")
9393
self.assertEqual(form['client_id'].value(), self.application.client_id)
9494

9595
def test_pre_auth_approval_prompt(self):
@@ -177,7 +177,7 @@ def test_code_post_auth_allow(self):
177177
form_data = {
178178
'client_id': self.application.client_id,
179179
'state': 'random_state_string',
180-
'scopes': 'read write',
180+
'scope': 'read write',
181181
'redirect_uri': 'http://example.it',
182182
'response_type': 'code',
183183
'allow': True,
@@ -198,7 +198,7 @@ def test_code_post_auth_deny(self):
198198
form_data = {
199199
'client_id': self.application.client_id,
200200
'state': 'random_state_string',
201-
'scopes': 'read write',
201+
'scope': 'read write',
202202
'redirect_uri': 'http://example.it',
203203
'response_type': 'code',
204204
'allow': False,
@@ -217,7 +217,7 @@ def test_code_post_auth_bad_responsetype(self):
217217
form_data = {
218218
'client_id': self.application.client_id,
219219
'state': 'random_state_string',
220-
'scopes': 'read write',
220+
'scope': 'read write',
221221
'redirect_uri': 'http://example.it',
222222
'response_type': 'UNKNOWN',
223223
'allow': True,
@@ -236,7 +236,7 @@ def test_code_post_auth_forbidden_redirect_uri(self):
236236
form_data = {
237237
'client_id': self.application.client_id,
238238
'state': 'random_state_string',
239-
'scopes': 'read write',
239+
'scope': 'read write',
240240
'redirect_uri': 'http://forbidden.it',
241241
'response_type': 'code',
242242
'allow': True,
@@ -254,7 +254,7 @@ def get_auth(self):
254254
authcode_data = {
255255
'client_id': self.application.client_id,
256256
'state': 'random_state_string',
257-
'scopes': 'read write',
257+
'scope': 'read write',
258258
'redirect_uri': 'http://example.it',
259259
'response_type': 'code',
260260
'allow': True,
@@ -559,7 +559,7 @@ def test_resource_access_allowed(self):
559559
authcode_data = {
560560
'client_id': self.application.client_id,
561561
'state': 'random_state_string',
562-
'scopes': 'read write',
562+
'scope': 'read write',
563563
'redirect_uri': 'http://example.it',
564564
'response_type': 'code',
565565
'allow': True,

oauth2_provider/tests/test_implicit.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ def test_pre_auth_valid_client(self):
6767
form = response.context["form"]
6868
self.assertEqual(form['redirect_uri'].value(), "http://example.it")
6969
self.assertEqual(form['state'].value(), "random_state_string")
70-
self.assertEqual(form['scopes'].value(), "read write")
70+
self.assertEqual(form['scope'].value(), "read write")
7171
self.assertEqual(form['client_id'].value(), self.application.client_id)
7272

7373
def test_pre_auth_invalid_client(self):
@@ -128,7 +128,7 @@ def test_post_auth_allow(self):
128128
form_data = {
129129
'client_id': self.application.client_id,
130130
'state': 'random_state_string',
131-
'scopes': 'read write',
131+
'scope': 'read write',
132132
'redirect_uri': 'http://example.it',
133133
'response_type': 'token',
134134
'allow': True,
@@ -149,7 +149,7 @@ def test_token_post_auth_deny(self):
149149
form_data = {
150150
'client_id': self.application.client_id,
151151
'state': 'random_state_string',
152-
'scopes': 'read write',
152+
'scope': 'read write',
153153
'redirect_uri': 'http://example.it',
154154
'response_type': 'token',
155155
'allow': False,
@@ -168,7 +168,7 @@ def test_resource_access_allowed(self):
168168
authcode_data = {
169169
'client_id': self.application.client_id,
170170
'state': 'random_state_string',
171-
'scopes': 'read write',
171+
'scope': 'read write',
172172
'redirect_uri': 'http://example.it',
173173
'response_type': 'token',
174174
'allow': True,

oauth2_provider/tests/test_scopes.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ def test_scopes_saved_in_grant(self):
7575
authcode_data = {
7676
'client_id': self.application.client_id,
7777
'state': 'random_state_string',
78-
'scopes': 'scope1 scope2',
78+
'scope': 'scope1 scope2',
7979
'redirect_uri': 'http://example.it',
8080
'response_type': 'code',
8181
'allow': True,
@@ -97,7 +97,7 @@ def test_scopes_save_in_access_token(self):
9797
authcode_data = {
9898
'client_id': self.application.client_id,
9999
'state': 'random_state_string',
100-
'scopes': 'scope1 scope2',
100+
'scope': 'scope1 scope2',
101101
'redirect_uri': 'http://example.it',
102102
'response_type': 'code',
103103
'allow': True,
@@ -133,7 +133,7 @@ def test_scopes_protection_valid(self):
133133
authcode_data = {
134134
'client_id': self.application.client_id,
135135
'state': 'random_state_string',
136-
'scopes': 'scope1 scope2',
136+
'scope': 'scope1 scope2',
137137
'redirect_uri': 'http://example.it',
138138
'response_type': 'code',
139139
'allow': True,
@@ -175,7 +175,7 @@ def test_scopes_protection_fail(self):
175175
authcode_data = {
176176
'client_id': self.application.client_id,
177177
'state': 'random_state_string',
178-
'scopes': 'scope2',
178+
'scope': 'scope2',
179179
'redirect_uri': 'http://example.it',
180180
'response_type': 'code',
181181
'allow': True,
@@ -217,7 +217,7 @@ def test_multi_scope_fail(self):
217217
authcode_data = {
218218
'client_id': self.application.client_id,
219219
'state': 'random_state_string',
220-
'scopes': 'scope1 scope3',
220+
'scope': 'scope1 scope3',
221221
'redirect_uri': 'http://example.it',
222222
'response_type': 'code',
223223
'allow': True,
@@ -259,7 +259,7 @@ def test_multi_scope_valid(self):
259259
authcode_data = {
260260
'client_id': self.application.client_id,
261261
'state': 'random_state_string',
262-
'scopes': 'scope1 scope2',
262+
'scope': 'scope1 scope2',
263263
'redirect_uri': 'http://example.it',
264264
'response_type': 'code',
265265
'allow': True,
@@ -300,7 +300,7 @@ def get_access_token(self, scopes):
300300
authcode_data = {
301301
'client_id': self.application.client_id,
302302
'state': 'random_state_string',
303-
'scopes': scopes,
303+
'scope': scopes,
304304
'redirect_uri': 'http://example.it',
305305
'response_type': 'code',
306306
'allow': True,

0 commit comments

Comments
 (0)