mirror of
https://gitlab.com/tildes/tildes.git
synced 2026-04-21 00:32:47 +02:00
cb7be83877
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.
21 lines
607 B
Python
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
|