Merge pull request #809 from jrocketfingers/feature/allow-textual-responses

Allow textual responses when using test_client and aiohttp 2
This commit is contained in:
Eli Uriegas 2017-06-20 10:30:26 -07:00 committed by GitHub
commit 10a363b275

View File

@ -32,7 +32,9 @@ class SanicTestClient:
try:
response.json = await response.json()
except (JSONDecodeError, UnicodeDecodeError):
except (JSONDecodeError,
UnicodeDecodeError,
aiohttp.ClientResponseError):
response.json = None
response.body = await response.read()