def METHOD_NAME(self, env):
    env = SandboxedEnvironment()
    pytest.raises(
        SecurityError, env.from_string("{{ foo.foo() }}").render, foo=PrivateStuff()
    )
    assert env.from_string("{{ foo.bar() }}").render(foo=PrivateStuff()) == "23"
    pytest.raises(
        SecurityError, env.from_string("{{ foo._foo() }}").render, foo=PublicStuff()
    )
    assert env.from_string("{{ foo.bar() }}").render(foo=PublicStuff()) == "23"
    assert env.from_string("{{ foo.__class__ }}").render(foo=42) == ""
    assert env.from_string("{{ foo.func_code }}").render(foo=lambda: None) == ""
    # security error comes from __class__ already.
    pytest.raises(
        SecurityError,
        env.from_string("{{ foo.__class__.__subclasses__() }}").render,
        foo=42,
    )