Esempio n. 1
0
 def test_adds_etag_header(self):
     etag = '123'
     response = HttpResponseXSendFile(request=None, path='/', etag=etag)
     assert response.has_header('ETag')
     assert response['ETag'] == quote_etag(etag)
Esempio n. 2
0
 def test_adds_content_disposition_header(self):
     response = HttpResponseXSendFile(request=None,
                                      path='/',
                                      attachment=True)
     assert response.has_header('Content-Disposition')
     assert response['Content-Disposition'] == 'attachment'
Esempio n. 3
0
 def test_normalizes_path(self):
     path = '/some/../path/'
     response = HttpResponseXSendFile(request=None, path=path)
     assert response[settings.XSENDFILE_HEADER] == os.path.normpath(path)
     assert not response.has_header('Content-Disposition')