← Back to team overview

launchpad-reviewers team mailing list archive

[Merge] ~lgp171188/launchpad:fix-favicon-changes-test-failures into launchpad:master

 

Guruprasad has proposed merging ~lgp171188/launchpad:fix-favicon-changes-test-failures into launchpad:master.

Commit message:
Fix test failures caused by the favicon update changes

* Add a self-closing tag for the <link> and <meta> elements.
* Update the favicon verification test to look for the specific <link>
element and the updated favicon image.


Requested reviews:
  Launchpad code reviewers (launchpad-reviewers)

For more details, see:
https://code.launchpad.net/~lgp171188/launchpad/+git/launchpad/+merge/424745
-- 
Your team Launchpad code reviewers is requested to review the proposed merge of ~lgp171188/launchpad:fix-favicon-changes-test-failures into launchpad:master.
diff --git a/lib/lp/app/browser/tests/test_base_layout.py b/lib/lp/app/browser/tests/test_base_layout.py
index d3c0c0b..271237f 100644
--- a/lib/lp/app/browser/tests/test_base_layout.py
+++ b/lib/lp/app/browser/tests/test_base_layout.py
@@ -90,9 +90,9 @@ class TestBaseLayout(TestCaseWithFactory):
         # The page's title starts with the view's page_title.
         self.assertTrue(head.title.string.startswith(view.page_title))
         # The shortcut icon for the browser chrome is provided.
-        link_tag = head.link
+        link_tag = head.find('link', rel='shortcut icon')
         self.assertEqual(['shortcut', 'icon'], link_tag['rel'])
-        self.assertEqual('/@@/launchpad.png', link_tag['href'])
+        self.assertEqual('/@@/favicon.ico?v=2022', link_tag['href'])
         # The template loads the common scripts.
         load_script = find_tag_by_id(head, 'base-layout-load-scripts').name
         self.assertEqual('script', load_script)
diff --git a/lib/lp/app/templates/base-layout.pt b/lib/lp/app/templates/base-layout.pt
index 4a0c73e..63a8ca8 100644
--- a/lib/lp/app/templates/base-layout.pt
+++ b/lib/lp/app/templates/base-layout.pt
@@ -25,15 +25,15 @@
   <head>
     <meta charset="UTF-8" />
     <title tal:content="view/fmt:pagetitle">Page Title</title>
-    <link rel="apple-touch-icon" sizes="180x180" href="/@@/apple-touch-icon.png?v=2022">
-    <link rel="icon" type="image/png" sizes="32x32" href="/@@/favicon-32x32.png?v=2022">
-    <link rel="icon" type="image/png" sizes="16x16" href="/@@/favicon-16x16.png?v=2022">
-    <link rel="manifest" href="/@@/site.webmanifest?v=2022">
-    <link rel="mask-icon" href="/@@/safari-pinned-tab.svg?v=2022" color="#e9531f">
-    <link rel="shortcut icon" href="/@@/favicon.ico?v=2022">
-    <meta name="msapplication-TileColor" content="#da532c">
-    <meta name="msapplication-config" content="/@@/browserconfig.xml?v=2022">
-    <meta name="theme-color" content="#ffffff">
+    <link rel="apple-touch-icon" sizes="180x180" href="/@@/apple-touch-icon.png?v=2022" />
+    <link rel="icon" type="image/png" sizes="32x32" href="/@@/favicon-32x32.png?v=2022" />
+    <link rel="icon" type="image/png" sizes="16x16" href="/@@/favicon-16x16.png?v=2022" />
+    <link rel="manifest" href="/@@/site.webmanifest?v=2022" />
+    <link rel="mask-icon" href="/@@/safari-pinned-tab.svg?v=2022" color="#e9531f" />
+    <link rel="shortcut icon" href="/@@/favicon.ico?v=2022" />
+    <meta name="msapplication-TileColor" content="#da532c" />
+    <meta name="msapplication-config" content="/@@/browserconfig.xml?v=2022" />
+    <meta name="theme-color" content="#ffffff" />
     <link
       rel="canonical"
       tal:define="url view/recommended_canonical_url | nothing"
diff --git a/lib/lp/services/feeds/stories/xx-navigation.txt b/lib/lp/services/feeds/stories/xx-navigation.txt
index 8c53f9d..02912d4 100644
--- a/lib/lp/services/feeds/stories/xx-navigation.txt
+++ b/lib/lp/services/feeds/stories/xx-navigation.txt
@@ -146,4 +146,4 @@ feeds.launchpad.test has a favicon.
 
     >>> browser.open('http://feeds.launchpad.test/favicon.ico')
     >>> print(browser.headers['Content-Type'])
-    image/png
+    image/vnd.microsoft.icon

Follow ups