1
0
mirror of https://github.com/django/django.git synced 2025-10-30 17:16:10 +00:00

Refs #26015 -- Added regression test for an empty sitemap.

This commit is contained in:
Andrew Kuchev
2016-01-25 00:35:46 +05:00
committed by Tim Graham
parent f05722a08a
commit 5b2e11e574
2 changed files with 11 additions and 1 deletions

View File

@@ -232,3 +232,11 @@ class HTTPSitemapTests(SitemapTestsBase):
</urlset>
""".format(self.base_url, self.i18n_model.pk)
self.assertXMLEqual(response.content.decode('utf-8'), expected_content)
def test_sitemap_without_entries(self):
response = self.client.get('/sitemap-without-entries/sitemap.xml')
expected_content = """<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
</urlset>"""
self.assertXMLEqual(response.content.decode('utf-8'), expected_content)