'Checks that format() calls which contain HTML() or Text() use HTML() or
Text() as the caller. In other words, Text() or HTML() must be used
before format() for any arguments to format() that contain HTML() or
Text().
Arguments:
node: An AST node.'

def visit_Call(self, node):

    if (isinstance(node.func, ast.Attribute) and (node.func.attr == 'format')):
        visitor = HtmlStringVisitor(self.file_contents, self.results, True)
        visitor.visit(node)
        for unsafe_html_string_node in visitor.unsafe_html_string_nodes:
            self.results.violations.append(ExpressionRuleViolation(Rules.python_wrap_html, self.node_to_expression(unsafe_html_string_node)))
    else:
        self.generic_visit(node)
