Esempio n. 1
0
 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))
Esempio n. 2
0
 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() )