Do not say a logo was taken from a page when none is included
Mirror to forge / mirror (push) Canceled after 0s
Validate / validate (push) Canceled after 0s
Validate / site (push) Canceled after 0s
Validate / deploy (push) Canceled after 0s

Fifteen records name where a trail's logo is held but include no logo
file. Their pages listed that link as "The page the logo was taken
from", with no logo anywhere on the page. The link now reads "The logo
holder's site; the logo is not included here", and the Logo section
says the trail has a logo, who holds it, and that no copy is in the
dataset.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
This commit is contained in:
swaitsandClaude Fable 5.2 committed 2026-11-13 14:46:35 -07:00
1 parent 48e1cc39fb
commit 249d866efe
2 files changed
+22 -2

No files matched your search

+11
View File
@@ -424,6 +424,17 @@ class RenderUnitTest(unittest.TestCase):
self.assertIn("History", plain)
self.assertIn("https://github.com/swaits/longhikes/commits/main/x", plain)
def test_logo_source_without_a_logo_file_is_not_called_taken_from(self):
# A record can name where its logo is held without including the logo.
rec = sample_record("X Trail")
rec["shield"] = {"status": "use-real-logo", "logo_source": "https://holder.example/", "contact": "Holder",
"note": "No policy found.", "logo_file": "", "logo_owner": "Holder & Co"}
_, _, body, _ = trail.render(rec, site.Site("N", "T"))
self.assertIn('href="https://holder.example/"', body)
self.assertNotIn("logo was taken from", body)
self.assertIn("the logo is not included here", body)
self.assertIn("The trail has a logo, held by Holder &amp; Co, but no copy of it is in this dataset.", body)
def test_trail_correction_links_github_branch(self):
gh = site.Site("N", "T", repo_url="https://github.com/o/r/", repo_branch="dev")
block = html.unescape(trail.correction_block(sample_record("X Trail"), gh))