(self, environ)
Sets up our Paste testing environment
Sets up our Paste testing environment
Sets up our Paste testing environment
def load_test_env(self, environ):
        """Sets up our Paste testing environment"""
        if self.log_debug:
            log.debug("Setting up paste testing environment variables")
        testenv = environ['paste.testing_variables']
        pylons_obj = environ['pylons.pylons']
        testenv['req'] = pylons_obj.request
        testenv['response'] = pylons_obj.response
        testenv['tmpl_context'] = pylons_obj.tmpl_context
        testenv['app_globals'] = testenv['g'] = pylons_obj.app_globals
        testenv['h'] = self.config['pylons.h']
        testenv['config'] = self.config
        if hasattr(pylons_obj, 'session'):
            testenv['session'] = pylons_obj.session
        if hasattr(pylons_obj, 'cache'):
            testenv['cache'] = pylons_obj.cache
        elif hasattr(pylons_obj.app_globals, 'cache'):
            testenv['cache'] = pylons_obj.app_globals.cache
def load_test_env ( self , environ ) : if self . log_debug : log . debug ( "Setting up paste testing environment variables" ) testenv = environ [ 'paste.testing_variables' ] pylons_obj = environ [ 'pylons.pylons' ] testenv [ 'req' ] = pylons_obj . request testenv [ 'response' ] = pylons_obj . response testenv [ 'tmpl_context' ] = pylons_obj . tmpl_context testenv [ 'app_globals' ] = testenv [ 'g' ] = pylons_obj . app_globals testenv [ 'h' ] = self . config [ 'pylons.h' ] testenv [ 'config' ] = self . config if hasattr ( pylons_obj , 'session' ) : testenv [ 'session' ] = pylons_obj . session if hasattr ( pylons_obj , 'cache' ) : testenv [ 'cache' ] = pylons_obj . cache elif hasattr ( pylons_obj . app_globals , 'cache' ) : testenv [ 'cache' ] = pylons_obj . app_globals . cache