Hi,

I wrote a decorator to handle this issue. To use it one simply have to
write :

class TestFoo(TestController):
    @with_identity('manager', password='managepass')
    def test_bar(self):
        pass

The decorator :

def with_identity(username, password=None):
    def entangle(fn):
        def new_fn(self, *args, **kw):
            login_response = self.app.get('/login_handler', dict
(login=username, password=password))
            fn(self, *args, **kw)
            logout_response = self.app.get('/logout_handler')

        new_fn.__name__ = fn.__name__
        return new_fn
    return entangle


--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to