diff --git a/pylons_app/tests/__init__.py b/pylons_app/tests/__init__.py --- a/pylons_app/tests/__init__.py +++ b/pylons_app/tests/__init__.py @@ -14,23 +14,23 @@ from paste.script.appinstall import Setu from pylons import config, url from routes.util import URLGenerator from webtest import TestApp +import os import pylons.test __all__ = ['environ', 'url', 'TestController'] # Invoke websetup with the current config file -SetupCommand('setup-app').run([config['__file__']]) +SetupCommand('setup-app').run([pylons.test.pylonsapp.config['__file__']]) environ = {} class TestController(TestCase): def __init__(self, *args, **kwargs): - if pylons.test.pylonsapp: - wsgiapp = pylons.test.pylonsapp - else: - wsgiapp = loadapp('config:%s' % config['__file__']) + wsgiapp = pylons.test.pylonsapp + config = wsgiapp.config self.app = TestApp(wsgiapp) url._push_object(URLGenerator(config['routes.map'], environ)) TestCase.__init__(self, *args, **kwargs) +