replace webob.Response with werkzeug Response

Replace webob usage in one more file. Document a TODO that should
be clarified, we should probably be using json_response rather than
Response() here.

Modify the TestMeddleware to not rely on the content_type attribute
being present, while werkzeug.wrappers Response() has it the BaseResponse()
object which is often returned in tests does not have it.

Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
This commit is contained in:
Sebastian Spaeth
2012-11-16 11:21:15 +01:00
parent bf3b9e783d
commit 74af60bb32
2 changed files with 5 additions and 3 deletions

View File

@@ -78,7 +78,7 @@ class TestingMeddleware(BaseMeddleware):
def process_response(self, request, response):
# All following tests should be for html only!
if response.content_type != "text/html":
if getattr(response, 'content_type', None) != "text/html":
# Get out early
return