Well, what the page is saying is that, for some reason, your 'self.app.get' is not generating a request object. I don't have a reason why, though. At the least, I need to ask the following of you:
1. Which version of TurboGears are you running these tests with? 2. Which version of TurboGears did you start with (need to check to see if maybe we missed something during the upgrade process) 3. If possible, is there a place where we can read the code and try it out for ourselves? On Fri, Sep 30, 2011 at 9:03 PM, Tim Black <[email protected]> wrote: > ** > I'm getting this error message when running my tests: > > ERROR: Failure: TypeError (No object (name: request) has been registered > for this thread) > ---------------------------------------------------------------------- > Traceback (most recent call last): > File > "/home/tim/Documents/MyWebPages/arwd/projects/tg21env-dev/lib/python2.6/site-packages/nose/loader.py", > line 390, in loadTestsFromName > addr.filename, addr.module) > File > "/home/tim/Documents/MyWebPages/arwd/projects/tg21env-dev/lib/python2.6/site-packages/nose/importer.py", > line 39, in importFromPath > return self.importFromDir(dir_path, fqname) > File > "/home/tim/Documents/MyWebPages/arwd/projects/tg21env-dev/lib/python2.6/site-packages/nose/importer.py", > line 86, in importFromDir > mod = load_module(part_fqname, fh, filename, desc) > File > "/home/tim/Documents/MyWebPages/arwd/projects/tg21env-dev/projects/projects/controllers/project/__init__.py", > line 24, in <module> > from projects.controllers.project.bill import BillController > File > "/home/tim/Documents/MyWebPages/arwd/projects/tg21env-dev/projects/projects/controllers/project/bill.py", > line 26, in <module> > class BillController(BaseController): > File > "/home/tim/Documents/MyWebPages/arwd/projects/tg21env-dev/projects/projects/controllers/project/bill.py", > line 28, in BillController > allow_only = is_manager or is_client > File > "/home/tim/Documents/MyWebPages/arwd/projects/tg21env-dev/lib/python2.6/site-packages/repoze/what/plugins/pylonshq/utils.py", > line 74, in <lambda> > Predicate.__nonzero__ = lambda self: self.is_met(request.environ) > File > "/home/tim/Documents/MyWebPages/arwd/projects/tg21env-dev/lib/python2.6/site-packages/paste/registry.py", > line 137, in __getattr__ > return getattr(self._current_obj(), attr) > File > "/home/tim/Documents/MyWebPages/arwd/projects/tg21env-dev/lib/python2.6/site-packages/paste/registry.py", > line 197, in _current_obj > 'thread' % self.____name__) > TypeError: No object (name: request) has been registered for this thread > > ---------------------------------------------------------------------- > Ran 1 test in 0.486s > > FAILED (errors=1) > > bootstrap.py creates a user named 'manager', puts him in the 'managers' > group and gives that group the 'manage' permission. is_manager checks to > see if the user has the 'manage' permission. > > projects/tests/__init__.py says: > > The projects application instance (``self.app``) set up in this test > case (and descendants) has authentication disabled, so that developers > can > test the protected areas independently of the :mod:`repoze.who` plugins > used initially. This way, authentication can be tested once and > separately. > > All tests of secure controllers contain code like this: > > environ = {'REMOTE_USER': 'manager'} > response = self.app.get('/project2/bill/view/1', > extra_environ=environ) > > The relevant ticket <http://trac.turbogears.org/ticket/2510> was closed > with a 'worksforme' status. > > What could be causing the error above? > > Tim > > > > -- > You received this message because you are subscribed to the Google Groups > "TurboGears" 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/turbogears?hl=en. > -- Michael J. Pedersen My IM IDs: Jabber/[email protected], AIM/pedermj022171 Yahoo/pedermj2002, MSN/[email protected] My Online Resume: http://www.icelus.org/ Twitter: pedersentg -- You received this message because you are subscribed to the Google Groups "TurboGears" 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/turbogears?hl=en.

