cubicweb/devtools/testlib.py
changeset 11800 3cd5ac8d43ed
parent 11767 432f87a63057
child 11801 7a7ce3da28fb
equal deleted inserted replaced
11799:1bdfe9d4ab83 11800:3cd5ac8d43ed
    25 from os.path import dirname, join, abspath
    25 from os.path import dirname, join, abspath
    26 from math import log
    26 from math import log
    27 from contextlib import contextmanager
    27 from contextlib import contextmanager
    28 from inspect import isgeneratorfunction
    28 from inspect import isgeneratorfunction
    29 from itertools import chain
    29 from itertools import chain
       
    30 from warnings import warn
    30 import tempfile
    31 import tempfile
    31 
    32 
    32 from six import text_type, string_types, reraise
    33 from six import text_type, string_types, reraise
    33 from six.moves import range
    34 from six.moves import range
    34 from six.moves.urllib.parse import urlparse, parse_qs, unquote as urlunquote
    35 from six.moves.urllib.parse import urlparse, parse_qs, unquote as urlunquote
   723         args = [json.dumps(arg) for arg in args]
   724         args = [json.dumps(arg) for arg in args]
   724         with self.admin_access.web_request(fname=fname, pageid='123', arg=args) as req:
   725         with self.admin_access.web_request(fname=fname, pageid='123', arg=args) as req:
   725             ctrl = self.vreg['controllers'].select('ajax', req)
   726             ctrl = self.vreg['controllers'].select('ajax', req)
   726             yield ctrl.publish(), req
   727             yield ctrl.publish(), req
   727 
   728 
   728     @application._deprecated_path_arg
   729     def app_handle_request(self, req, path=None):
   729     def app_handle_request(self, req):
   730         if path is not None:
       
   731             warn('[3.24] path argument got removed from app_handle_request parameters, '
       
   732                  'give it to the request constructor', DeprecationWarning)
       
   733             if req.relative_path(False) != path:
       
   734                 req._url = path
   730         return self.app.core_handle(req)
   735         return self.app.core_handle(req)
   731 
   736 
   732     @deprecated("[3.15] app_handle_request is the new and better way"
   737     @deprecated("[3.15] app_handle_request is the new and better way"
   733                 " (beware of small semantic changes)")
   738                 " (beware of small semantic changes)")
   734     def app_publish(self, *args, **kwargs):
   739     def app_publish(self, *args, **kwargs):