def METHOD_NAME():
    class HasHTMLOnly:
        def __html__(self):
            return Markup("<foo>")
    class HasHTMLAndFormat:
        def __html__(self):
            return Markup("<foo>")
        def __html_format__(self, spec):
            return Markup("<FORMAT>")
    assert Markup("{0}").format(HasHTMLOnly()) == Markup("<foo>")
    assert Markup("{0}").format(HasHTMLAndFormat()) == Markup("<FORMAT>")