Exemplo n.º 1
0
 def test_webaccess_firerole_serialization(self):
     """webaccess - firerole role definition correctly serialized"""
     from invenio_access.control import acc_get_role_definition
     from invenio_access.firerole import compile_role_definition, \
         deserialize
     def_ser = compile_role_definition(self.role_definition)
     tmp_def_ser = acc_get_role_definition(self.role_id)
     self.assertEqual(def_ser, deserialize(tmp_def_ser))
 def test_webaccess_firerole_serialization(self):
     """webaccess - firerole role definition correctly serialized"""
     from invenio_access.control import acc_get_role_definition
     from invenio_access.firerole import compile_role_definition, \
         deserialize
     def_ser = compile_role_definition(self.role_definition)
     tmp_def_ser = acc_get_role_definition(self.role_id)
     self.assertEqual(def_ser, deserialize(tmp_def_ser))
Exemplo n.º 3
0
 def setUp(self):
     """Create a fake role."""
     from invenio_access.control import acc_add_role
     from invenio_access.firerole import compile_role_definition, \
         serialize
     self.role_name = 'test'
     self.role_description = 'test role'
     self.role_definition = 'allow email /.*@cern.ch/'
     self.role_id, dummy, dummy, dummy = acc_add_role(
         self.role_name, self.role_description,
         serialize(compile_role_definition(self.role_definition)),
         self.role_definition)
 def setUp(self):
     """Create a fake role."""
     from invenio_access.control import acc_add_role
     from invenio_access.firerole import compile_role_definition, \
         serialize
     self.role_name = 'test'
     self.role_description = 'test role'
     self.role_definition = 'allow email /.*@cern.ch/'
     self.role_id, dummy, dummy, dummy = acc_add_role(self.role_name,
         self.role_description,
         serialize(compile_role_definition(self.role_definition)),
         self.role_definition)