Commit 4b4130e8 by Tom Christie

Fix request cloning, so method becomes set

parent 566812ac
...@@ -86,7 +86,7 @@ def clone_request(request, method): ...@@ -86,7 +86,7 @@ def clone_request(request, method):
ret._full_data = request._full_data ret._full_data = request._full_data
ret._content_type = request._content_type ret._content_type = request._content_type
ret._stream = request._stream ret._stream = request._stream
ret._method = method ret.method = method
if hasattr(request, '_user'): if hasattr(request, '_user'):
ret._user = request._user ret._user = request._user
if hasattr(request, '_auth'): if hasattr(request, '_auth'):
...@@ -139,7 +139,6 @@ class Request(object): ...@@ -139,7 +139,6 @@ class Request(object):
self._data = Empty self._data = Empty
self._files = Empty self._files = Empty
self._full_data = Empty self._full_data = Empty
self._method = Empty
self._content_type = Empty self._content_type = Empty
self._stream = Empty self._stream = Empty
......
...@@ -3,27 +3,22 @@ Tests for content parsing, and form-overloaded content parsing. ...@@ -3,27 +3,22 @@ Tests for content parsing, and form-overloaded content parsing.
""" """
from __future__ import unicode_literals from __future__ import unicode_literals
import json
from io import BytesIO
import django import django
import pytest import pytest
from django.conf.urls import url from django.conf.urls import url
from django.contrib.auth import authenticate, login, logout from django.contrib.auth import authenticate, login, logout
from django.contrib.auth.models import User from django.contrib.auth.models import User
from django.contrib.sessions.middleware import SessionMiddleware from django.contrib.sessions.middleware import SessionMiddleware
from django.core.handlers.wsgi import WSGIRequest
from django.test import TestCase from django.test import TestCase
from django.utils import six from django.utils import six
from rest_framework import status from rest_framework import status
from rest_framework.authentication import SessionAuthentication from rest_framework.authentication import SessionAuthentication
from rest_framework.parsers import ( 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.response import Response
from rest_framework.settings import api_settings
from rest_framework.test import APIClient, APIRequestFactory from rest_framework.test import APIClient, APIRequestFactory
from rest_framework.views import APIView from rest_framework.views import APIView
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment