diff --git a/refstack/tests/api/__init__.py b/refstack/tests/api/__init__.py index 481f3d53..c57e6c08 100644 --- a/refstack/tests/api/__init__.py +++ b/refstack/tests/api/__init__.py @@ -167,7 +167,7 @@ class FunctionalTest(base.BaseTestCase): expect_errors=expect_errors, params=params) - if not expect_errors: + if not expect_errors and response.content_type == 'application/json': response = response.json return response @@ -200,7 +200,7 @@ class FunctionalTest(base.BaseTestCase): content_type=content_type, **params) - if not expect_errors: + if not expect_errors and response.content_type == 'application/json': response = response.json return response @@ -216,6 +216,6 @@ class FunctionalTest(base.BaseTestCase): content_type=content_type, **params) - if not expect_errors: + if not expect_errors and response.content_type == 'application/json': response = response.json return response