Test that get_serializer is not called when overriden

Views' ``get_serializer`` methods should not be called when the serializer is provided by ``request_body`` or ``responses``.

Closes #154
This commit is contained in:
Cristi Vîjdea
2018-06-29 17:41:37 +03:00
parent ee7b9a0734
commit e0aec3ff45
2 changed files with 36 additions and 2 deletions
+2 -1
View File
@@ -89,7 +89,8 @@ class SwaggerAutoSchema(ViewInspector):
try:
return self.view.get_serializer()
except Exception:
log.warning("view's get_serializer raised exception (%s)", type(self.view).__name__, exc_info=True)
log.warning("view's get_serializer raised exception (%s %s %s)",
self.method, self.path, type(self.view).__name__, exc_info=True)
return None
def get_request_serializer(self):