def _init_thread(self, job, global_env): # make sure that pylons.g is available for the worker thread g._push_object(global_env) try: job() finally: # free it up g._pop_object()
def setUp(): g._push_object(Globals()) c._push_object(mock.Mock()) request._push_object(Request.blank('/')) ThreadLocalORMSession.close_all() M.EmailAddress.query.remove({}) M.OpenIdNonce.query.remove({}) M.OpenIdAssociation.query.remove({})
def setUp(): g._push_object(Globals()) c._push_object(mock.Mock()) c.user._id = None c.project = mock.Mock() c.project.name = 'Test Project' c.project.shortname = 'tp' c.project._id = 'testproject/' c.project.database_uri = 'mim://nosetest:project' c.project.url = lambda: '/testproject/' app_config = mock.Mock() app_config._id = None app_config.project_id = 'testproject/' app_config.tool_name = 'tool' app_config.options = Object(mount_point = 'foo') c.app = mock.Mock() c.app.config = app_config c.app.config.script_name = lambda:'/testproject/test_application/' c.app.config.url = lambda:'http://testproject/test_application/' c.app.url = c.app.config.url() c.app.__version__ = '0.0'