summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorTim Graham <timograham@gmail.com>2013-10-08 08:05:39 -0400
committerTim Graham <timograham@gmail.com>2013-10-08 08:05:39 -0400
commit58d555caf527d6f1bdfeab14527484e4cca68648 (patch)
tree175e77804c7a4606e16392a023f339e6967acee5 /tests
parentddb53856b62506128a6d19184dfa80da73c77db8 (diff)
Fixed #16822 -- Added RawPostDataException
Thanks jaylett for the patch.
Diffstat (limited to 'tests')
-rw-r--r--tests/requests/tests.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/tests/requests/tests.py b/tests/requests/tests.py
index b5edc09deb..45e219f345 100644
--- a/tests/requests/tests.py
+++ b/tests/requests/tests.py
@@ -12,7 +12,8 @@ from django.db import connection, connections, DEFAULT_DB_ALIAS
from django.core import signals
from django.core.exceptions import SuspiciousOperation
from django.core.handlers.wsgi import WSGIRequest, LimitedStream
-from django.http import HttpRequest, HttpResponse, parse_cookie, build_request_repr, UnreadablePostError
+from django.http import (HttpRequest, HttpResponse, parse_cookie,
+ build_request_repr, UnreadablePostError, RawPostDataException)
from django.test import SimpleTestCase, TransactionTestCase
from django.test.client import FakePayload
from django.test.utils import override_settings, str_prefix
@@ -263,7 +264,7 @@ class RequestsTests(SimpleTestCase):
'CONTENT_LENGTH': len(payload),
'wsgi.input': payload})
self.assertEqual(request.read(2), b'na')
- self.assertRaises(Exception, lambda: request.body)
+ self.assertRaises(RawPostDataException, lambda: request.body)
self.assertEqual(request.POST, {})
def test_non_ascii_POST(self):
@@ -308,7 +309,7 @@ class RequestsTests(SimpleTestCase):
'CONTENT_LENGTH': len(payload),
'wsgi.input': payload})
self.assertEqual(request.POST, {'name': ['value']})
- self.assertRaises(Exception, lambda: request.body)
+ self.assertRaises(RawPostDataException, lambda: request.body)
def test_body_after_POST_multipart_related(self):
"""