cubicweb/test/unittest_rset.py
changeset 11913 4516c3956d46
parent 11892 08cf02efc7ce
child 12063 4bcb58aa103a
equal deleted inserted replaced
11912:c9e6df20e5a4 11913:4516c3956d46
   117                               '%stask/title/go' % baseurl)
   117                               '%stask/title/go' % baseurl)
   118             #self.compare_urls(req.build_url('view', _restpath='/task/title/go'),
   118             #self.compare_urls(req.build_url('view', _restpath='/task/title/go'),
   119             #                  '%stask/title/go' % baseurl)
   119             #                  '%stask/title/go' % baseurl)
   120             # empty _restpath should not crash
   120             # empty _restpath should not crash
   121             self.compare_urls(req.build_url('view', _restpath=''), baseurl)
   121             self.compare_urls(req.build_url('view', _restpath=''), baseurl)
   122             self.assertNotIn('https', req.build_url('view', vid='foo', rql='yo',
       
   123                                                       __secure__=True))
       
   124             try:
       
   125                 self.config.global_set_option('https-url', 'https://testing.fr/')
       
   126                 self.assertTrue('https', req.build_url('view', vid='foo', rql='yo',
       
   127                                                          __secure__=True))
       
   128                 self.compare_urls(req.build_url('view', vid='foo', rql='yo',
       
   129                                                 __secure__=True),
       
   130                                   '%sview?vid=foo&rql=yo' % req.base_url(secure=True))
       
   131             finally:
       
   132                 self.config.global_set_option('https-url', None)
       
   133 
   122 
   134 
   123 
   135     def test_build(self):
   124     def test_build(self):
   136         """test basic build of a ResultSet"""
   125         """test basic build of a ResultSet"""
   137         rs = ResultSet([1,2,3], 'CWGroup X', description=['CWGroup', 'CWGroup', 'CWGroup'])
   126         rs = ResultSet([1,2,3], 'CWGroup X', description=['CWGroup', 'CWGroup', 'CWGroup'])