code: def test_legacy_custom_context(self, env):
      from jinja2.runtime import Context, missing
  
      class MyContext(Context):
          def resolve(self, name):
              if name == "foo":
                  return 42
              return super(MyContext, self).resolve(name)
  
      x = MyContext(env, parent={"bar": 23}, name="foo", blocks={})
      assert x._legacy_resolve_mode
      assert x.resolve_or_missing("foo") == 42
      assert x.resolve_or_missing("bar") == 23
      assert x.resolve_or_missing("baz") is missing
  
imports: import sys
  import pytest
  from jinja2 import DictLoader
  from jinja2 import Environment
  from jinja2 import PrefixLoader
  from jinja2 import Template
  from jinja2 import TemplateAssertionError
  from jinja2 import TemplateNotFound
  from jinja2 import TemplateSyntaxError
  from jinja2._compat import text_type
label_desc: Use image node_id 39 for calling the TestBug obj's underlying member method code with example usage: obj.test_legacy_custom_context(env) and returns: super, int