diff options
| author | Mariusz Felisiak <felisiak.mariusz@gmail.com> | 2022-02-08 12:27:04 +0100 |
|---|---|---|
| committer | Mariusz Felisiak <felisiak.mariusz@gmail.com> | 2022-02-08 19:25:02 +0100 |
| commit | 3278c31fa59b41d03aea167f4cf85f4ddf7f848d (patch) | |
| tree | 0c80b4868391296335580242c8e65052a4f62a6b /tests/sitemaps_tests/test_https.py | |
| parent | 6a682b38e75d4c975b4c4493565a59f1bc14397c (diff) | |
[4.0.x] Refs #33476 -- Refactored code to strictly match 88 characters line length.
Backport of 7119f40c9881666b6f9b5cf7df09ee1d21cc8344 from main.
Diffstat (limited to 'tests/sitemaps_tests/test_https.py')
| -rw-r--r-- | tests/sitemaps_tests/test_https.py | 26 |
1 files changed, 16 insertions, 10 deletions
diff --git a/tests/sitemaps_tests/test_https.py b/tests/sitemaps_tests/test_https.py index 7fc46e0d8e..6b12885a9a 100644 --- a/tests/sitemaps_tests/test_https.py +++ b/tests/sitemaps_tests/test_https.py @@ -25,11 +25,14 @@ class HTTPSSitemapTests(SitemapTestsBase): def test_secure_sitemap_section(self): "A secure sitemap section can be rendered" response = self.client.get("/secure/sitemap-simple.xml") - expected_content = """<?xml version="1.0" encoding="UTF-8"?> -<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9" xmlns:xhtml="http://www.w3.org/1999/xhtml"> -<url><loc>%s/location/</loc><lastmod>%s</lastmod><changefreq>never</changefreq><priority>0.5</priority></url> -</urlset> -""" % ( + expected_content = ( + '<?xml version="1.0" encoding="UTF-8"?>\n' + '<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9" ' + 'xmlns:xhtml="http://www.w3.org/1999/xhtml">\n' + "<url><loc>%s/location/</loc><lastmod>%s</lastmod>" + "<changefreq>never</changefreq><priority>0.5</priority></url>\n" + "</urlset>" + ) % ( self.base_url, date.today(), ) @@ -55,11 +58,14 @@ class HTTPSDetectionSitemapTests(SitemapTestsBase): def test_sitemap_section_with_https_request(self): "A sitemap section requested in HTTPS is rendered with HTTPS links" response = self.client.get("/simple/sitemap-simple.xml", **self.extra) - expected_content = """<?xml version="1.0" encoding="UTF-8"?> -<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9" xmlns:xhtml="http://www.w3.org/1999/xhtml"> -<url><loc>%s/location/</loc><lastmod>%s</lastmod><changefreq>never</changefreq><priority>0.5</priority></url> -</urlset> -""" % ( + expected_content = ( + '<?xml version="1.0" encoding="UTF-8"?>\n' + '<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9" ' + 'xmlns:xhtml="http://www.w3.org/1999/xhtml">\n' + "<url><loc>%s/location/</loc><lastmod>%s</lastmod>" + "<changefreq>never</changefreq><priority>0.5</priority></url>\n" + "</urlset>" + ) % ( self.base_url.replace("http://", "https://"), date.today(), ) |
