def METHOD_NAME(context, stream):
    content = getattr(context.process, stream).strip()
    text = process_template_vars(context, context.text)
    if text not in content:
        raise AssertionError(
            (
                "Expected to find substring:\n{}\n"
                + "But couldn't find it in:\n{}"
            ).format(
                textwrap.indent(text, "  "), textwrap.indent(content, "  ")
            )
        )