summaryrefslogtreecommitdiff
path: root/webtest/response.py
diff options
context:
space:
mode:
authorhomm <homm86@gmail.com>2013-08-02 14:06:36 +0400
committerhomm <homm86@gmail.com>2013-08-02 14:06:36 +0400
commit052132f523c88be3b8b25bd5b95d4b2bf21df362 (patch)
tree49af33497e7fcdf4ee58d2a3d7306fe5b70ffa32 /webtest/response.py
parent61b344b05653c32dea8b99e833098565f20579ed (diff)
downloadwebtest-052132f523c88be3b8b25bd5b95d4b2bf21df362.tar.gz
Fix json detection in response
Diffstat (limited to 'webtest/response.py')
-rw-r--r--webtest/response.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/webtest/response.py b/webtest/response.py
index f6027fd..b091f01 100644
--- a/webtest/response.py
+++ b/webtest/response.py
@@ -493,9 +493,9 @@ class TestResponse(webob.Response):
<http://goo.gl/B9g6s>`_ installed to use this, or be using a Python
version with the json module.
- The content type must be application/json to use this.
+ The content type must be one of json type to use this.
"""
- if self.content_type != 'application/json':
+ if not self.content_type.endswith(('+json', '/json')):
raise AttributeError(
"Not a JSON response body (content-type: %s)"
% self.content_type)