Coverage for rfpy/api/endpoints/reports/responses.py: 100%

6 statements  

« prev     ^ index     » next       coverage.py v7.0.1, created at 2022-12-31 16:00 +0000

1from webob import Response 

2 

3 

4def attachment(content, content_type, filename): 

5 """Create Response object representing an attachment""" 

6 

7 response = Response(content) 

8 response.content_type = str(content_type) 

9 response.content_disposition = str('attachment; filename="%s"' % filename.replace('"', '\\"')) 

10 

11 return response