mirror of
https://github.com/django/django.git
synced 2025-08-04 02:48:35 +00:00
Refs #33476 -- Refactored code to strictly match 88 characters line length.
This commit is contained in:
parent
9c19aff7c7
commit
7119f40c98
404 changed files with 5944 additions and 2842 deletions
|
@ -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(),
|
||||
)
|
||||
|
@ -56,11 +59,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(),
|
||||
)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue