cubicweb/devtools/testlib.py
changeset 11929 fcbd6b251d81
parent 11874 ea1d92b677b5
parent 11902 6c320c41b1a0
child 12027 c62c80f20a82
equal deleted inserted replaced
11920:f13799fbcfea 11929:fcbd6b251d81
   411         config.global_set_option('default-dest-addrs', send_to)
   411         config.global_set_option('default-dest-addrs', send_to)
   412         config.global_set_option('sender-name', 'cubicweb-test')
   412         config.global_set_option('sender-name', 'cubicweb-test')
   413         config.global_set_option('sender-addr', 'cubicweb-test@logilab.fr')
   413         config.global_set_option('sender-addr', 'cubicweb-test@logilab.fr')
   414         # default_base_url on config class isn't enough for TestServerConfiguration
   414         # default_base_url on config class isn't enough for TestServerConfiguration
   415         config.global_set_option('base-url', config.default_base_url())
   415         config.global_set_option('base-url', config.default_base_url())
   416         # web resources
       
   417         try:
       
   418             config.global_set_option('embed-allowed', re.compile('.*'))
       
   419         except Exception:  # not in server only configuration
       
   420             pass
       
   421 
   416 
   422     @property
   417     @property
   423     def vreg(self):
   418     def vreg(self):
   424         return self.repo.vreg
   419         return self.repo.vreg
   425 
   420 
  1288         for action in self.list_actions_for(rset):
  1283         for action in self.list_actions_for(rset):
  1289             with self.subTest(name=self._testname(rset, action.__regid__, 'action')):
  1284             with self.subTest(name=self._testname(rset, action.__regid__, 'action')):
  1290                 self._test_action(action)
  1285                 self._test_action(action)
  1291         for box in self.list_boxes_for(rset):
  1286         for box in self.list_boxes_for(rset):
  1292             w = [].append
  1287             w = [].append
  1293             with self.subTest(self._testname(rset, box.__regid__, 'box')):
  1288             with self.subTest(name=self._testname(rset, box.__regid__, 'box')):
  1294                 box.render(w)
  1289                 box.render(w)
  1295 
  1290 
  1296     @staticmethod
  1291     @staticmethod
  1297     def _testname(rset, objid, objtype):
  1292     def _testname(rset, objid, objtype):
  1298         return '%s_%s_%s' % ('_'.join(rset.column_types(0)), objid, objtype)
  1293         return '%s_%s_%s' % ('_'.join(rset.column_types(0)), objid, objtype)