devtools/testlib.py
changeset 8363 3f3b4e4c63f5
parent 8318 e8a2fd7d9606
child 8463 a964c40adbe3
equal deleted inserted replaced
8362:4ac28926cd15 8363:3f3b4e4c63f5
   609         return ctrl.publish(), req
   609         return ctrl.publish(), req
   610 
   610 
   611     def app_handle_request(self, req, path='view'):
   611     def app_handle_request(self, req, path='view'):
   612         return self.app.core_handle(req, path)
   612         return self.app.core_handle(req, path)
   613 
   613 
       
   614     @deprecated("[3.15] app_handle_request is the new and better way"
       
   615                 " (beware of small semantic changes)")
       
   616     def app_publish(self, *args, **kwargs):
       
   617         return self.app_handle_request(*args, **kwargs)
       
   618 
   614     def ctrl_publish(self, req, ctrl='edit'):
   619     def ctrl_publish(self, req, ctrl='edit'):
   615         """call the publish method of the edit controller"""
   620         """call the publish method of the edit controller"""
   616         ctrl = self.vreg['controllers'].select(ctrl, req, appli=self.app)
   621         ctrl = self.vreg['controllers'].select(ctrl, req, appli=self.app)
   617         try:
   622         try:
   618             result = ctrl.publish()
   623             result = ctrl.publish()
   677         """
   682         """
   678         result = self.app_handle_request(req, path)
   683         result = self.app_handle_request(req, path)
   679         self.assertTrue(300 <= req.status_out <400, req.status_out)
   684         self.assertTrue(300 <= req.status_out <400, req.status_out)
   680         location = req.get_response_header('location')
   685         location = req.get_response_header('location')
   681         return self._parse_location(req, location)
   686         return self._parse_location(req, location)
       
   687 
       
   688     @deprecated("[3.15] expect_redirect_handle_request is the new and better way"
       
   689                 " (beware of small semantic changes)")
       
   690     def expect_redirect_publish(self, *args, **kwargs):
       
   691         return self.expect_redirect_handle_request(*args, **kwargs)
       
   692 
   682 
   693 
   683     def set_auth_mode(self, authmode, anonuser=None):
   694     def set_auth_mode(self, authmode, anonuser=None):
   684         self.set_option('auth-mode', authmode)
   695         self.set_option('auth-mode', authmode)
   685         self.set_option('anonymous-user', anonuser)
   696         self.set_option('anonymous-user', anonuser)
   686         if anonuser is None:
   697         if anonuser is None: