'A custom action may return a StreamingHttpResponse.'

def test_custom_function_action_streaming_response(self):

    action_data = {ACTION_CHECKBOX_NAME: [self.s1.pk], 'action': 'download', 'index': 0}
    response = self.client.post(reverse('admin:admin_views_externalsubscriber_changelist'), action_data)
    content = ''.join(response.streaming_content)
    self.assertEqual(content, 'This    is    the    content    of    the    file')
    self.assertEqual(response.status_code, 200)
