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
4b4130e8
Commit
4b4130e8
authored
Sep 17, 2015
by
Tom Christie
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix request cloning, so method becomes set
parent
566812ac
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
9 deletions
+3
-9
rest_framework/request.py
+1
-2
tests/test_request.py
+2
-7
No files found.
rest_framework/request.py
View file @
4b4130e8
...
...
@@ -86,7 +86,7 @@ def clone_request(request, method):
ret
.
_full_data
=
request
.
_full_data
ret
.
_content_type
=
request
.
_content_type
ret
.
_stream
=
request
.
_stream
ret
.
_
method
=
method
ret
.
method
=
method
if
hasattr
(
request
,
'_user'
):
ret
.
_user
=
request
.
_user
if
hasattr
(
request
,
'_auth'
):
...
...
@@ -139,7 +139,6 @@ class Request(object):
self
.
_data
=
Empty
self
.
_files
=
Empty
self
.
_full_data
=
Empty
self
.
_method
=
Empty
self
.
_content_type
=
Empty
self
.
_stream
=
Empty
...
...
tests/test_request.py
View file @
4b4130e8
...
...
@@ -3,27 +3,22 @@ Tests for content parsing, and form-overloaded content parsing.
"""
from
__future__
import
unicode_literals
import
json
from
io
import
BytesIO
import
django
import
pytest
from
django.conf.urls
import
url
from
django.contrib.auth
import
authenticate
,
login
,
logout
from
django.contrib.auth.models
import
User
from
django.contrib.sessions.middleware
import
SessionMiddleware
from
django.core.handlers.wsgi
import
WSGIRequest
from
django.test
import
TestCase
from
django.utils
import
six
from
rest_framework
import
status
from
rest_framework.authentication
import
SessionAuthentication
from
rest_framework.parsers
import
(
BaseParser
,
FormParser
,
JSONParser
,
MultiPartParser
BaseParser
,
FormParser
,
MultiPartParser
)
from
rest_framework.request
import
Empty
,
Request
from
rest_framework.request
import
Request
from
rest_framework.response
import
Response
from
rest_framework.settings
import
api_settings
from
rest_framework.test
import
APIClient
,
APIRequestFactory
from
rest_framework.views
import
APIView
...
...
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