Let the tests that forbid inline and outside scripts allow the Google tag, and nothing else
Mirror to forge / mirror (push) Canceled after 0s
Validate / validate (push) Canceled after 0s
Validate / history (push) Canceled after 0s
Validate / site (push) Canceled after 0s
Validate / deploy (push) Canceled after 0s

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
This commit is contained in:
swaitsandClaude Fable 5.2 committed 2026-11-20 15:18:55 -07:00
1 parent 0d6197bedd
commit 99588ce306
4 files changed
+23 -6

No files matched your search

+7 -2
View File
@@ -128,10 +128,15 @@ class HeaderOnEveryPageTest(unittest.TestCase):
for rel in self.files:
doc = read_out(rel)
self.assertNotIn("<style", doc, rel)
inline = 0
for tag, a, _ in tree(doc).tags:
self.assertFalse([k for k in a if k.startswith("on")], f"{tag} in {rel}")
if tag == "script":
self.assertTrue(a.get("src") or a.get("type") in ("application/json", "application/ld+json"), rel)
if tag == "script" and not (a.get("src") or a.get("type") in ("application/json", "application/ld+json")):
inline += 1
# The one inline script is the Google tag's data-layer setup, allowed by its hash.
self.assertLessEqual(inline, 1, rel)
if inline:
self.assertIn("<script>" + layout.GOOGLE_TAG_INLINE + "</script>", doc, rel)
def test_the_switches_name_what_they_do(self):
prefs = layout.prefs()