summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGael Pasgrimaud <gael@gawel.org>2017-03-15 09:15:01 +0100
committerGael Pasgrimaud <gael@gawel.org>2017-03-15 09:15:01 +0100
commit3a6a8539b7240780eb7c3bbf4090d700cc58f257 (patch)
tree7b33add6e8ab2d56779be1efd63e9ac5c729de38
parentb35063f1bc6f6b0cd92b68c56838f385b56e8d00 (diff)
downloadwebtest-3a6a8539b7240780eb7c3bbf4090d700cc58f257.tar.gz
.json now return .json_body; fixed #177
-rw-r--r--webtest/response.py7
1 files changed, 2 insertions, 5 deletions
diff --git a/webtest/response.py b/webtest/response.py
index e00f65a..0364d5b 100644
--- a/webtest/response.py
+++ b/webtest/response.py
@@ -493,17 +493,14 @@ class TestResponse(webob.Response):
@property
def json(self):
"""
- Return the response as a JSON response. You must have `simplejson
- <http://goo.gl/B9g6s>`_ installed to use this, or be using a Python
- version with the json module.
-
+ Return the response as a JSON response.
The content type must be one of json type to use this.
"""
if not self.content_type.endswith(('+json', '/json')):
raise AttributeError(
"Not a JSON response body (content-type: %s)"
% self.content_type)
- return loads(self.testbody)
+ return self.json_body
@property
def pyquery(self):