Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
D
django-rest-framework
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
edx
django-rest-framework
Commits
b86765d9
Commit
b86765d9
authored
Nov 15, 2013
by
Philip Forget
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add auth param to request client calls
parent
4b947a6a
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
2 deletions
+4
-2
rest_framework/tests/test_authentication.py
+4
-2
No files found.
rest_framework/tests/test_authentication.py
View file @
b86765d9
...
...
@@ -362,7 +362,8 @@ class OAuthTests(TestCase):
def
test_post_form_with_urlencoded_parameters
(
self
):
"""Ensure POSTing with x-www-form-urlencoded auth parameters passes"""
params
=
self
.
_create_authorization_url_parameters
()
response
=
self
.
csrf_client
.
post
(
'/oauth/'
,
params
)
auth
=
self
.
_create_authorization_header
()
response
=
self
.
csrf_client
.
post
(
'/oauth/'
,
params
,
HTTP_AUTHORIZATION
=
auth
)
self
.
assertEqual
(
response
.
status_code
,
200
)
@unittest.skipUnless
(
oauth_provider
,
'django-oauth-plus not installed'
)
...
...
@@ -424,7 +425,8 @@ class OAuthTests(TestCase):
read_write_access_token
.
resource
.
is_readonly
=
False
read_write_access_token
.
resource
.
save
()
params
=
self
.
_create_authorization_url_parameters
()
response
=
self
.
csrf_client
.
post
(
'/oauth-with-scope/'
,
params
)
auth
=
self
.
_create_authorization_header
()
response
=
self
.
csrf_client
.
post
(
'/oauth-with-scope/'
,
params
,
HTTP_AUTHORIZATION
=
auth
)
self
.
assertEqual
(
response
.
status_code
,
200
)
@unittest.skipUnless
(
oauth_provider
,
'django-oauth-plus not installed'
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment