def setUp(self): try: import Zope2 as Zope except ImportError: import Zope if hasattr(Zope, 'startup'): Zope.startup() try: from transaction import begin except ImportError: get_transaction().begin() else: begin() self._policy = PermissiveSecurityPolicy() self._oldPolicy = setSecurityPolicy(self._policy) self.connection = Zope.DB.open() self.root = self.connection.root()['Application'] newSecurityManager(None, OmnipotentUser().__of__(self.root))
def __init__(self): setattr( self, 'user_foo', DummyUser(id='user_foo') ) setattr( self, 'user_bar', DummyUser(id='user_bar') ) setattr( self, 'all_powerful_Oz', OmnipotentUser() )