summaryrefslogtreecommitdiff
path: root/django/contrib/sitemaps/tests/test_https.py
diff options
context:
space:
mode:
Diffstat (limited to 'django/contrib/sitemaps/tests/test_https.py')
-rw-r--r--django/contrib/sitemaps/tests/test_https.py12
1 files changed, 11 insertions, 1 deletions
diff --git a/django/contrib/sitemaps/tests/test_https.py b/django/contrib/sitemaps/tests/test_https.py
index 1ded723d74..3de6b7bb35 100644
--- a/django/contrib/sitemaps/tests/test_https.py
+++ b/django/contrib/sitemaps/tests/test_https.py
@@ -1,8 +1,10 @@
from __future__ import unicode_literals
from datetime import date
+import warnings
from django.test import override_settings
+from django.utils.deprecation import RemovedInDjango20Warning
from .base import SitemapTestsBase
@@ -38,7 +40,15 @@ class HTTPSDetectionSitemapTests(SitemapTestsBase):
def test_sitemap_index_with_https_request(self):
"A sitemap index requested in HTTPS is rendered with HTTPS links"
- response = self.client.get('/simple/index.xml', **self.extra)
+ with warnings.catch_warnings():
+ warnings.filterwarnings("ignore", category=RemovedInDjango20Warning)
+ # The URL for views.sitemap in tests/urls/http.py has been updated
+ # with a name but since reversing by Python path is tried first
+ # before reversing by name and works since we're giving
+ # name='django.contrib.sitemaps.views.sitemap', we need to silence
+ # the erroneous warning until reversing by dotted path is removed.
+ # The test will work without modification when it's removed.
+ response = self.client.get('/simple/index.xml', **self.extra)
expected_content = """<?xml version="1.0" encoding="UTF-8"?>
<sitemapindex xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
<sitemap><loc>%s/simple/sitemap-simple.xml</loc></sitemap>