cubicweb/pyramid/test/test_bw_request.py
changeset 11913 4516c3956d46
parent 11812 4e0829ade86f
child 12088 477a59a45786
equal deleted inserted replaced
11912:c9e6df20e5a4 11913:4516c3956d46
    30                 'CONTENT_LENGTH': 12,
    30                 'CONTENT_LENGTH': 12,
    31                 'CONTENT_TYPE': 'text/plain',
    31                 'CONTENT_TYPE': 'text/plain',
    32                 'wsgi.input': BytesIO(b'some content')}))
    32                 'wsgi.input': BytesIO(b'some content')}))
    33 
    33 
    34         self.assertEqual(b'some content', req.content.read())
    34         self.assertEqual(b'some content', req.content.read())
    35 
       
    36     def test_http_scheme(self):
       
    37         req = CubicWebPyramidRequest(
       
    38             self.make_request('/', {
       
    39                 'wsgi.url_scheme': 'http'}))
       
    40 
       
    41         self.assertFalse(req.https)
       
    42 
       
    43     def test_https_scheme(self):
       
    44         req = CubicWebPyramidRequest(
       
    45             self.make_request('/', {
       
    46                 'wsgi.url_scheme': 'https'}))
       
    47 
       
    48         self.assertTrue(req.https)
       
    49 
       
    50     def test_https_prefix(self):
       
    51         r = self.webapp.get('/https/')
       
    52         self.assertIn('https://', r.text)
       
    53 
    35 
    54     def test_big_content(self):
    36     def test_big_content(self):
    55         content = b'x' * 100001
    37         content = b'x' * 100001
    56 
    38 
    57         req = CubicWebPyramidRequest(
    39         req = CubicWebPyramidRequest(