Closed rleonhardt closed 4 years ago
Oh, all the mocks forward args and kwargs unkown in DownloadResponse.__init__()
, sorry.
Maybe an additional **kwargs would solve that, have to test it...
Updated BaseDownloadViewTestCase to not use dummy args/kwargs but kwargs which BaseDownloadView.get()
actually forwards to DownloadResponse.__init__()
.
Now I have catched all locations which used/forwarded response_kwargs to DownloadResponse.__init__()
or django.http.HttpResponseBase.__init__()
, tests are green, please review, if this change is useful to you.
BaseDownloadView.get()
should forward _args, *_kwargs torender_to_response()
to allow overriding default values like content_type inDownloadResponse.__init__()
.In addition, binary mime types like application/pdf should not contain a charset attribute in
DownloadResponse.get_content_type()
. Unfortunately the used mimetypes module from the standard library does not offer a text/binary differentiation, and a text/ prefix would not be sufficient, application/javascript is text for example.