Files
tildes/tildes/tests/webtests/test_valid_html5.py
T
Andrew Shu cb7be83877 Build HTML Tidy, validate homepage HTML in tests
Adds the HTML Tidy library to the dev version, along with the pytidylib
wrapper for it, and a couple of tests that use it to validate the HTML
of the home page.

Includes a fix to the GitLab "Planned features" link that Tidy considers
invalid because it includes some un-encoded characters.
2020-08-01 14:20:57 -06:00

21 lines
607 B
Python

# Copyright (c) 2020 Tildes contributors <code@tildes.net>
# SPDX-License-Identifier: AGPL-3.0-or-later
from tidylib import tidy_document
def test_homepage_tidy_loggedout(webtest_loggedout):
"""Validate HTML5 using Tidy on the Tildes homepage, logged out."""
homepage = webtest_loggedout.get("/")
_document, errors = tidy_document(homepage.body)
assert not errors
def test_homepage_tidy_loggedin(webtest):
"""Validate HTML5 using Tidy on the Tildes homepage, logged in."""
homepage = webtest.get("/")
_document, errors = tidy_document(homepage.body)
assert not errors