server/test/unittest_repository.py
branchstable
changeset 6364 ad9ed9803eb6
parent 6361 843684a50e48
child 6366 1806148d6ce8
child 6385 9f91d09ee5fa
equal deleted inserted replaced
6363:b9ec8ebc187a 6364:ad9ed9803eb6
   156                               self.execute, 'SET X name "toto" WHERE X is CWGroup, X name "guests"')
   156                               self.execute, 'SET X name "toto" WHERE X is CWGroup, X name "guests"')
   157             self.failIf(self.execute('Any X WHERE X is CWGroup, X name "toto"'))
   157             self.failIf(self.execute('Any X WHERE X is CWGroup, X name "toto"'))
   158 
   158 
   159     def test_rollback_on_execute_unauthorized(self):
   159     def test_rollback_on_execute_unauthorized(self):
   160         class UnauthorizedAfterHook(Hook):
   160         class UnauthorizedAfterHook(Hook):
   161             __regid__ = 'valerror-after-hook'
   161             __regid__ = 'unauthorized-after-hook'
   162             __select__ = Hook.__select__ & is_instance('CWGroup')
   162             __select__ = Hook.__select__ & is_instance('CWGroup')
   163             events = ('after_update_entity',)
   163             events = ('after_update_entity',)
   164             def __call__(self):
   164             def __call__(self):
   165                 raise Unauthorized()
   165                 raise Unauthorized()
   166         with self.temporary_appobjects(UnauthorizedAfterHook):
   166         with self.temporary_appobjects(UnauthorizedAfterHook):