equal
deleted
inserted
replaced
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): |