code: def test_markup_operations(self, env):
      # adding two strings should escape the unsafe one
      unsafe = '<script type="application/x-some-script">alert("foo");</script>'
      safe = Markup("<em>username</em>")
      assert unsafe + safe == text_type(escape(unsafe)) + text_type(
          safe
      )
  
      # string interpolations are safe to use too
      assert (
          Markup("<em>%s</em>") % "<bad user>"
          == "<em>&lt;bad user&gt;</em>"
      )
      assert (
          Markup("<em>%(username)s</em>") % {"username": "<bad user>"}
          == "<em>&lt;bad user&gt;</em>"
      )
  
      # an escaped object is markup too
      assert type(Markup("foo") + "bar") is Markup
  
      # and it implements __html__ by returning itself
      x = Markup("foo")
      assert x.__html__() is x
  
      # it also knows how to treat __html__ objects
      class Foo(object):
          def __html__(self):
              return "<em>awesome</em>"
  
          def __unicode__(self):
              return "awesome"
  
      assert Markup(Foo()) == "<em>awesome</em>"
      assert (
          Markup("<strong>%s</strong>") % Foo()
          == "<strong><em>awesome</em></strong>"
      )
  
      # escaping and unescaping
      assert escape("\"<>&'") == "&#34;&lt;&gt;&amp;&#39;"
      assert Markup("<em>Foo &amp; Bar</em>").striptags() == "Foo & Bar"
      assert Markup("&lt;test&gt;").unescape() == "<test>"
  
imports: import pytest
  from jinja2 import Environment
  from jinja2 import escape
  from jinja2 import Markup
  from jinja2._compat import text_type
  from jinja2.exceptions import SecurityError
  from jinja2.exceptions import TemplateRuntimeError
  from jinja2.exceptions import TemplateSyntaxError
  from jinja2.nodes import EvalContext
  from jinja2.sandbox import ImmutableSandboxedEnvironment
  from jinja2.sandbox import SandboxedEnvironment
  from jinja2.sandbox import unsafe
label_desc: Use image node_id 4 for calling the TestSandbox obj's underlying member method code with example usage: obj.test_markup_operations(env) and returns: str, str