'Compression is performed on FileResponse.'

def test_compress_file_response(self):

    with open(__file__, 'rb') as file1:
        file_resp = FileResponse(file1)
        file_resp['Content-Type'] = 'text/html;    charset=UTF-8'
        r = GZipMiddleware().process_response(self.req, file_resp)
        with open(__file__, 'rb') as file2:
            self.assertEqual(self.decompress(''.join(r)), file2.read())
        self.assertEqual(r.get('Content-Encoding'), 'gzip')
        self.assertIsNot(r.file_to_stream, file1)
