From eaf542c163a244f7c993443d83caaff496db136f Mon Sep 17 00:00:00 2001 From: Cyril Roelandt Date: Tue, 26 Apr 2016 15:45:28 +0200 Subject: [PATCH] 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 --- barbican/api/hooks.py | 2 +- tox.ini | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/barbican/api/hooks.py b/barbican/api/hooks.py index fcb314465..5b502e898 100644 --- a/barbican/api/hooks.py +++ b/barbican/api/hooks.py @@ -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 diff --git a/tox.ini b/tox.ini index 29d1fd4d8..a203d6842 100644 --- a/tox.ini +++ b/tox.ini @@ -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 \