Ejemplo n.º 1
0
 def _to_permissions(self, *permissions):
     return list(
         filter(
             lambda x: x is not None,
             [Permissions.find(permission) for permission in permissions],
         )
     )
Ejemplo n.º 2
0
 def test_find_fail(self):
     permission = Permissions.find("doesntexist")
     self.assertIsNone(permission)
Ejemplo n.º 3
0
 def test_find(self):
     permission = Permissions.find("ADMIN")
     self.assertIsNotNone(permission)
     self.assertEqual(permission.get_name(), "Admin")