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