diff --git a/tests/sitemaps_tests/test_http.py b/tests/sitemaps_tests/test_http.py
index 38a79a03f2c..5b3cbb58438 100644
--- a/tests/sitemaps_tests/test_http.py
+++ b/tests/sitemaps_tests/test_http.py
@@ -232,3 +232,11 @@ class HTTPSitemapTests(SitemapTestsBase):
""".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 = """
+
+
+"""
+ self.assertXMLEqual(response.content.decode('utf-8'), expected_content)
diff --git a/tests/sitemaps_tests/urls/http.py b/tests/sitemaps_tests/urls/http.py
index fcc5964d7ac..6a6269be96d 100644
--- a/tests/sitemaps_tests/urls/http.py
+++ b/tests/sitemaps_tests/urls/http.py
@@ -168,7 +168,9 @@ urlpatterns = [
url(r'^cached/index\.xml$', cache_page(1)(views.index),
{'sitemaps': simple_sitemaps, 'sitemap_url_name': 'cached_sitemap'}),
url(r'^cached/sitemap-(?P.+)\.xml', cache_page(1)(views.sitemap),
- {'sitemaps': simple_sitemaps}, name='cached_sitemap')
+ {'sitemaps': simple_sitemaps}, name='cached_sitemap'),
+ url(r'^sitemap-without-entries/sitemap\.xml$', views.sitemap,
+ {'sitemaps': {}}, name='django.contrib.sitemaps.views.sitemap'),
]
urlpatterns += i18n_patterns(