diff --git a/rest_framework/request.py b/rest_framework/request.py index 98a70eb3a..76bf496ce 100644 --- a/rest_framework/request.py +++ b/rest_framework/request.py @@ -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 diff --git a/tests/test_request.py b/tests/test_request.py index c328460f3..49f99a832 100644 --- a/tests/test_request.py +++ b/tests/test_request.py @@ -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