Python3: fix barbican.tests.api.controllers.test_cas

In Python 3, Response.body must be set to bytes.

Partially implements: blueprint barbican-py3

Change-Id: I913d55bea89788b9ca4ad83fec8d96dc9ccd073c
This commit is contained in:
Cyril Roelandt 2016-04-26 15:45:28 +02:00
parent 47d87754ec
commit eaf542c163
2 changed files with 2 additions and 1 deletions

View File

@ -29,7 +29,7 @@ from barbican.model import repositories
class JSONErrorHook(pecan.hooks.PecanHook):
def on_error(self, state, exc):
if isinstance(exc, webob.exc.HTTPError):
exc.body = jsonutils.dumps({
exc.body = jsonutils.dump_as_bytes({
'code': exc.status_int,
'title': exc.title,
'description': exc.detail

View File

@ -29,6 +29,7 @@ commands = sphinx-build -a -E -W -d releasenotes/build/doctrees -b html releasen
commands =
/usr/bin/find . -type f -name "*.pyc" -delete
python -m testtools.run \
barbican.tests.api.controllers.test_cas \
barbican.tests.api.controllers.test_versions \
barbican.tests.api.middleware.test_context \
barbican.tests.api.middleware.test_simple \