fixed unit tests

This commit is contained in:
Yun Xu
2018-02-27 22:25:38 -08:00
parent c39ddd00d3
commit d1a8e8b042
3 changed files with 53 additions and 24 deletions

View File

@@ -59,7 +59,9 @@ class SanicTestClient:
@self.app.exception(MethodNotSupported)
async def error_handler(request, exception):
if request.method in ['HEAD', 'PATCH', 'PUT', 'DELETE']:
return text('', exception.status_code, headers=exception.headers)
return text(
'', exception.status_code, headers=exception.headers
)
else:
return self.app.error_handler.default(request, exception)