mirror of
https://github.com/django/django.git
synced 2025-10-24 06:06:09 +00:00
Refs #22384 -- Removed the ability to reverse URLs by dotted path per deprecation timeline.
This commit is contained in:
@@ -2,8 +2,7 @@ from __future__ import unicode_literals
|
||||
|
||||
from datetime import date
|
||||
|
||||
from django.test import ignore_warnings, override_settings
|
||||
from django.utils.deprecation import RemovedInDjango110Warning
|
||||
from django.test import override_settings
|
||||
|
||||
from .base import SitemapTestsBase
|
||||
|
||||
@@ -12,15 +11,8 @@ from .base import SitemapTestsBase
|
||||
class HTTPSSitemapTests(SitemapTestsBase):
|
||||
protocol = 'https'
|
||||
|
||||
@ignore_warnings(category=RemovedInDjango110Warning)
|
||||
def test_secure_sitemap_index(self):
|
||||
"A secure sitemap index can be rendered"
|
||||
# The URL for views.sitemap in tests/urls/https.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('/secure/index.xml')
|
||||
expected_content = """<?xml version="1.0" encoding="UTF-8"?>
|
||||
<sitemapindex xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
|
||||
@@ -44,15 +36,8 @@ class HTTPSSitemapTests(SitemapTestsBase):
|
||||
class HTTPSDetectionSitemapTests(SitemapTestsBase):
|
||||
extra = {'wsgi.url_scheme': 'https'}
|
||||
|
||||
@ignore_warnings(category=RemovedInDjango110Warning)
|
||||
def test_sitemap_index_with_https_request(self):
|
||||
"A sitemap index requested in HTTPS is rendered with HTTPS links"
|
||||
# The URL for views.sitemap in tests/urls/https.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">
|
||||
|
||||
Reference in New Issue
Block a user