# retoor def test_home_is_molodetz(anon): html = anon.get("/").text assert "Molodetz" in html for label in ("Rol", "Standaard", "Flyers", "Memes", "Mensen", "Binnen"): assert f">{label}" in html assert "wa.me" not in html and "whatsapp" not in html.lower() def test_unknown_page_is_404(anon): response = anon.get("/bestaat-niet-xyz") assert response.status_code == 404 assert anon.get("/bestaat-niet-xyz", headers={"Accept": "application/json"}).json()["error"] def _intro_section(html): from bs4 import BeautifulSoup return BeautifulSoup(html, "html.parser").select_one("section.hero [data-intro]") def test_intro_renders_on_home(anon): from molodetz.constants import SITE_INTRO_SEED intro = _intro_section(anon.get("/").text) assert intro is not None paragraphs = intro.find_all("p", recursive=False) assert len(paragraphs) == len([block for block in SITE_INTRO_SEED.split("\n\n") if block.strip()]) assert paragraphs[0].get_text(" ", strip=True).startswith("I wrote more code than you. I wrote more code than the best programmer you know.") assert paragraphs[-1].get_text(strip=True) == "Will you be the one that will be replaced? Or will you be the one that will replace. Look at the guy next to you." assert len(paragraphs[1].find_all("br")) == 5 text = intro.get_text(" ", strip=True) for fixed in ("especially since it was", "Well, for starters", "development environment", "more divided in skills", "i triple down", "No professional texts", "it must have been worth", "measure its usage", "Buy now.", 'Vibe "Coders"'): assert fixed in text, fixed for typo in ("sicne", "deelopment", "devided", "tripple", "teksts", "have be worth", "it s usage", "\u1e82"): assert typo not in text, typo assert "