def __init__(self, *args, **kwargs):
wsgiapp = loadapp('config:test.ini', relative_to=conf_dir)
config = wsgiapp.config
pylons.app_globals._push_object(config['pylons.app_globals'])
pylons.config._push_object(config)
# Initialize a translator for tests that utilize i18n
translator = _get_translator(pylons.config.get('lang'))
pylons.translator._push_object(translator)
url._push_object(URLGenerator(config['routes.map'], environ))
self.app = TestApp(wsgiapp)
TestCase.__init__(self, *args, **kwargs)
评论列表
文章目录