End-to-end testing Django applications using Pytest with Playwright
summary
A Django HTMX to‑do app is tested with pytest and Playwright, using BeautifulSoup for HTML assertions and the live_server and page fixtures to run a real browser against a running Django process. Unit-style tests run in about 0.5s, full end-to-end Playwright tests about 2s. Playwright’s expect/expect_response replaces sleeps to avoid flakiness, Playwright Python lacks JS coverage, and the recommended strategy is a mix of fast unit tests plus targeted e2e checks.
AI-written summary · about
