aboutsummaryrefslogtreecommitdiffstats
path: root/rest_framework
diff options
context:
space:
mode:
Diffstat (limited to 'rest_framework')
-rw-r--r--rest_framework/parsers.py17
-rw-r--r--rest_framework/tests/request.py15
2 files changed, 14 insertions, 18 deletions
diff --git a/rest_framework/parsers.py b/rest_framework/parsers.py
index 5325a64b..672f6a16 100644
--- a/rest_framework/parsers.py
+++ b/rest_framework/parsers.py
@@ -98,23 +98,6 @@ class YAMLParser(BaseParser):
raise ParseError('YAML parse error - %s' % unicode(exc))
-class PlainTextParser(BaseParser):
- """
- Plain text parser.
- """
-
- media_type = 'text/plain'
-
- def parse_stream(self, stream, **opts):
- """
- Returns a 2-tuple of `(data, files)`.
-
- `data` will simply be a string representing the body of the request.
- `files` will always be `None`.
- """
- return stream.read()
-
-
class FormParser(BaseParser):
"""
Parser for form data.
diff --git a/rest_framework/tests/request.py b/rest_framework/tests/request.py
index 7b24b036..f00ee85f 100644
--- a/rest_framework/tests/request.py
+++ b/rest_framework/tests/request.py
@@ -10,9 +10,9 @@ from rest_framework import status
from rest_framework.authentication import SessionAuthentication
from django.test.client import RequestFactory
from rest_framework.parsers import (
+ BaseParser,
FormParser,
MultiPartParser,
- PlainTextParser,
JSONParser
)
from rest_framework.request import Request
@@ -24,6 +24,19 @@ from rest_framework.views import APIView
factory = RequestFactory()
+class PlainTextParser(BaseParser):
+ media_type = 'text/plain'
+
+ def parse_stream(self, stream, **opts):
+ """
+ Returns a 2-tuple of `(data, files)`.
+
+ `data` will simply be a string representing the body of the request.
+ `files` will always be `None`.
+ """
+ return stream.read()
+
+
class TestMethodOverloading(TestCase):
def test_method(self):
"""