server/test/unittest_security.py
changeset 3447 0a0f8df4a2f7
parent 3293 69c0ba095536
child 3890 d7a270f50f54
equal deleted inserted replaced
3446:fc5055a09550 3447:0a0f8df4a2f7
   502         try:
   502         try:
   503             aff = cu.execute('Any X WHERE X ref "ARCT01"').get_entity(0, 0)
   503             aff = cu.execute('Any X WHERE X ref "ARCT01"').get_entity(0, 0)
   504             aff.fire_transition('abort')
   504             aff.fire_transition('abort')
   505             cnx.commit()
   505             cnx.commit()
   506             # though changing a user state (even logged user) is reserved to managers
   506             # though changing a user state (even logged user) is reserved to managers
   507             user = cnx.user(self.current_session())
   507             user = cnx.user(self.session)
   508             # XXX wether it should raise Unauthorized or ValidationError is not clear
   508             # XXX wether it should raise Unauthorized or ValidationError is not clear
   509             # the best would probably ValidationError if the transition doesn't exist
   509             # the best would probably ValidationError if the transition doesn't exist
   510             # from the current state but Unauthorized if it exists but user can't pass it
   510             # from the current state but Unauthorized if it exists but user can't pass it
   511             self.assertRaises(ValidationError, user.fire_transition, 'deactivate')
   511             self.assertRaises(ValidationError, user.fire_transition, 'deactivate')
   512         finally:
   512         finally: