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

6 statements  

« prev     ^ index     » next       coverage.py v7.12.0, created at 2025-12-03 01:35 +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( 

10 'attachment; filename="%s"' % filename.replace('"', '\\"') 

11 ) 

12 

13 return response