async def test_complex_expression(self):
        """Test complex expression with multiple operators"""
        perm1 = TestAsyncPermission(True)
        perm2 = TestAsyncPermission(False)
        perm3 = TestAsyncPermission(True)

        # (True AND False) OR (NOT True) = False OR False = False
        and_op = perm1 & perm2
        not_op = ~perm3
        expression = and_op | not_op
        assert await expression.has_permission_async(None, None) is False

        # (True OR False) AND (NOT False) = True AND True = True
        or_op = perm1 | perm2
        not_op = ~TestAsyncPermission(False)
        expression = or_op & not_op
        assert await expression.has_permission_async(None, None) is True
Test complex expression with multiple operators
tests/test_async_permissions.py