mirror of
https://github.com/django/django.git
synced 2025-11-01 12:25:37 +00:00
Fixed #14753 -- Fixed the test client to not raise an AssertionError when request.raw_post_data is accessed from a view it has fetched with GET. Thanks zimnyx for the report and ojii for the patch.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@15254 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
parent
19bfdadc43
commit
190f6e5b45
4 changed files with 14 additions and 1 deletions
|
|
@ -879,3 +879,12 @@ class ResponseTemplateDeprecationTests(TestCase):
|
|||
def test_response_no_template(self):
|
||||
response = self.client.get("/test_client_regress/request_methods/")
|
||||
self.assertEqual(response.template, None)
|
||||
|
||||
class RawPostDataTest(TestCase):
|
||||
"Access to request.raw_post_data from the test client."
|
||||
def test_raw_post_data(self):
|
||||
# Refs #14753
|
||||
try:
|
||||
response = self.client.get("/test_client_regress/raw_post_data/")
|
||||
except AssertionError:
|
||||
self.fail("Accessing request.raw_post_data from a view fetched with GET by the test client shouldn't fail.")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue