import re from app import app def show(tag, path, host, c=None, need=()): cc = c or app.test_client() r = cc.get(path, headers={"Host": host}) h = r.data.decode("utf-8", "replace") miss = [m for m in need if m not in h] print(r.status_code, tag.ljust(11), path, "| BRAK:" + (",".join(miss) if miss else "-")) admin = app.test_client() with admin.session_transaction() as s: s["username"] = "admin" s["is_admin"] = True s["csrf_token"] = "X" show("main", "/", "paganlinux.eu", need=['class="flg"', "nav-admin"]) show("about", "/about?lang=pl", "paganlinux.eu", need=['flg" data-lang="pl"']) show("docs", "/", "docs.paganlinux.eu", need=['flg" data-lang=', "PL"]) show("doc", "/docs/getting-started?lang=pl", "docs.paganlinux.eu", need=['flg" data-lang=']) show("git", "/", "git.paganlinux.eu") show("repo", "/", "repo.paganlinux.eu") show("admin", "/admin", "paganlinux.eu", c=admin, need=["