mirror of
https://github.com/django/django.git
synced 2025-10-24 22:26:08 +00:00
Refs #27395 -- Added XML namespace declaration to sitemap template.
As per Google recommendations: https://support.google.com/webmasters/answer/189077?hl=en
This commit is contained in:
committed by
Carlton Gibson
parent
948a874425
commit
50e1ccbbea
@@ -23,7 +23,7 @@ class HTTPSSitemapTests(SitemapTestsBase):
|
||||
"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">
|
||||
<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>
|
||||
""" % (self.base_url, date.today())
|
||||
@@ -48,7 +48,7 @@ class HTTPSDetectionSitemapTests(SitemapTestsBase):
|
||||
"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">
|
||||
<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>
|
||||
""" % (self.base_url.replace('http://', 'https://'), date.today())
|
||||
|
||||
Reference in New Issue
Block a user