Does unit testing work with subdomains? It seems as though if I use "map.sub_domains = True" in routing.py, then "url_for" function will not work inside any of the controller unit tests, i.e., I get the error from above: 'thread._local' object has no attribute 'environ'. For some reason the environ attribute does not get set on the _RequestConfig object.
I've been looking over the routes source to see what is going on, but I'm pretty much stuck for now. Any help is mucho appreciated. -c On Feb 17, 9:56 pm, Chris <[EMAIL PROTECTED]> wrote: > Hi, > I've been trying to follow this > tutorialhttp://wiki.pylonshq.com/display/pylonsdocs/Unit+Testing > But keep getting this error below for every test. > > Any tips would be much appreciated. > > Thanks, > Chris > > ====================================================================== > ERROR: test_index > (project.tests.functional.test_home.TestHomeController) > ---------------------------------------------------------------------- > Traceback (most recent call last): > File "/home/chris/projects/project.com/project/project/tests/ > functional/test_home.py", line 6, in test_index > response = self.app.get(url_for(controller='home')) > File "/usr/lib/python2.5/site-packages/Routes-1.7.1-py2.5.egg/routes/ > util.py", line 185, in url_for > newargs = _screenargs(kargs) > File "/usr/lib/python2.5/site-packages/Routes-1.7.1-py2.5.egg/routes/ > util.py", line 48, in _screenargs > memory_kargs = _subdomain_check(config, memory_kargs) > File "/usr/lib/python2.5/site-packages/Routes-1.7.1-py2.5.egg/routes/ > util.py", line 59, in _subdomain_check > fullhost = config.environ.get('HTTP_HOST') or \ > File "/usr/lib/python2.5/site-packages/Routes-1.7.1-py2.5.egg/routes/ > __init__.py", line 14, in __getattr__ > return getattr(self.__shared_state, name) > AttributeError: 'thread._local' object has no attribute 'environ' > > ---------------------------------------------------------------------- --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
