mirror of
https://github.com/encode/django-rest-framework.git
synced 2024-11-10 19:56:59 +03:00
Fix request cloning, so method becomes set
This commit is contained in:
parent
566812ac0b
commit
4b4130e8b2
|
@ -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
|
||||
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user