def METHOD_NAME(app):
    def source_read_handler(_app, _relative_path, _parent_docname, source):
        text = source[0].replace("#magical", "amazing")
        source[0] = text
    app.connect("include-read", source_read_handler)
    text = ".. include:: baz/baz.rst\n"
    app.env.find_files(app.config, app.builder)
    doctree = restructuredtext.parse(app, text, 'index')
    assert_node(doctree, addnodes.document)
    assert len(doctree.children) == 3
    assert_node(doctree.children[1], nodes.paragraph)
    assert doctree.children[1].rawsource == "The amazing foo."