I have upgraded from 0.9.6 to 1.0. After the upgrade, the tests don't
work complaining that:
UnboundLocalError: local variable 'url' referenced before assignment
in my functional tests, whereas the url has been imported in my tests/
__init__.py
import pylons
from unittest import TestCase
from paste.deploy import loadapp
from paste.fixture import TestApp
from pylons import config
# from pylons import url
from pylons import url
# from routes.util import url
from paste.deploy import loadapp
from paste.script.appinstall import SetupCommand
from routes.util import URLGenerator
from webtest import TestApp
import pylons.test
__all__ = ['environ','url', 'TestController']
# SetupCommand('setup-
app').run([pylons.test.pylonsapp.config['__file__']])
SetupCommand('setup-app').run(['test.ini'])
environ = {}
class TestController(TestCase):
def __init__(self, *args, **kwargs):
wsgiapp = pylons.test.pylonsapp
config = wsgiapp.config
self.app = TestApp(wsgiapp)
url._push_object(URLGenerator(config['routes.map'], environ))
TestCase.__init__(self, *args, **kwargs)
Some help would really be great as I am stumped with this and there is
little to go on.
--
You received this message because you are subscribed to the Google Groups
"pylons-discuss" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/pylons-discuss?hl=en.