Example #1
0
 def test_delete_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, ALL_RESOURCES, 'edit')
     handler = ResourcePoolHandler(user, {}, None)
     handler.delete({"id": pool.id})
     self.assertIsNone(reload_object(pool))
Example #2
0
 def test_delete(self):
     handler = ResourcePoolHandler(factory.make_admin(), {}, None)
     pool = factory.make_ResourcePool()
     handler.delete({"id": pool.id})
     self.assertIsNone(reload_object(pool))