import re


def text_in_page(tmp_proj, page_path, text):
    """
    Test if string exists in page.
    """
    page = tmp_proj / "site" / page_path
    assert page.exists(), "%s does not exist" % page_path
    contents = page.read_text(encoding="utf-8")
    return re.search(text, contents)