def METHOD_NAME(self):
    class HasHTMLOnly(object):
        def __html__(self):
            return Markup('<foo>')
    class HasHTMLAndFormat(object):
        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>')