@temporary_media_root()
    def test_download_response(self):
        setup_document()
        url = reverse('object:deserialized_basename', kwargs={'slug': slug})
        response = self.client.get(url)
        assert_download_response(self,
                                 response,
                                 content=file_content,
                                 basename=basename,
                                 mime_type='text/plain')
'deserialized_basename' streams Document.file with custom basename.
dataset/ETHPy150Open benoitbryon/django-downloadview/demo/demoproject/object/tests.py/DeserializedBasenameTestCase.test_download_response