예제 #1
0
 def test_update(self):
     pool = factory.make_ResourcePool()
     new_name = factory.make_name('pool')
     handler = ResourcePoolHandler(factory.make_admin(), {}, None)
     handler.update({"id": pool.id, "name": new_name})
     pool = reload_object(pool)
     self.assertEqual(new_name, pool.name)
예제 #2
0
 def test_update_rbac(self):
     self.enable_rbac()
     user = factory.make_User()
     pool = factory.make_ResourcePool()
     self.rbac_store.add_pool(pool)
     self.rbac_store.allow(user.username, pool, 'view')
     self.rbac_store.allow(user.username, pool, 'edit')
     new_name = factory.make_name('pool')
     handler = ResourcePoolHandler(user, {}, None)
     handler.update({"id": pool.id, "name": new_name})
     pool = reload_object(pool)
     self.assertEqual(new_name, pool.name)