summaryrefslogtreecommitdiff
path: root/tests/sitemaps_tests
diff options
context:
space:
mode:
authorTim Graham <timograham@gmail.com>2015-08-17 13:45:07 -0400
committerTim Graham <timograham@gmail.com>2015-09-23 19:31:09 -0400
commit785cc71d5b3300e2702b0b2fc7316e58ca70b563 (patch)
treedc526b6b3df79c0da82694f0879713f33c0dee3c /tests/sitemaps_tests
parentd79122f40ba2016b1a943e2e1ba46984b2ef99ad (diff)
Refs #22384 -- Removed the ability to reverse URLs by dotted path per deprecation timeline.
Diffstat (limited to 'tests/sitemaps_tests')
-rw-r--r--tests/sitemaps_tests/test_http.py24
-rw-r--r--tests/sitemaps_tests/test_https.py17
2 files changed, 2 insertions, 39 deletions
diff --git a/tests/sitemaps_tests/test_http.py b/tests/sitemaps_tests/test_http.py
index a6bc46e03a..399cd35ae6 100644
--- a/tests/sitemaps_tests/test_http.py
+++ b/tests/sitemaps_tests/test_http.py
@@ -9,9 +9,8 @@ from django.conf import settings
from django.contrib.sitemaps import GenericSitemap, Sitemap
from django.contrib.sites.models import Site
from django.core.exceptions import ImproperlyConfigured
-from django.test import ignore_warnings, modify_settings, override_settings
+from django.test import modify_settings, override_settings
from django.utils._os import upath
-from django.utils.deprecation import RemovedInDjango110Warning
from django.utils.formats import localize
from django.utils.translation import activate, deactivate
@@ -21,15 +20,8 @@ from .models import TestModel
class HTTPSitemapTests(SitemapTestsBase):
- @ignore_warnings(category=RemovedInDjango110Warning)
def test_simple_sitemap_index(self):
"A simple sitemap index can be rendered"
- # 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')
expected_content = """<?xml version="1.0" encoding="UTF-8"?>
<sitemapindex xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
@@ -38,19 +30,12 @@ class HTTPSitemapTests(SitemapTestsBase):
""" % self.base_url
self.assertXMLEqual(response.content.decode('utf-8'), expected_content)
- @ignore_warnings(category=RemovedInDjango110Warning)
@override_settings(TEMPLATES=[{
'BACKEND': 'django.template.backends.django.DjangoTemplates',
'DIRS': [os.path.join(os.path.dirname(upath(__file__)), 'templates')],
}])
def test_simple_sitemap_custom_index(self):
"A simple sitemap index can be rendered with a custom template"
- # 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/custom-index.xml')
expected_content = """<?xml version="1.0" encoding="UTF-8"?>
<!-- This is a customised template -->
@@ -194,14 +179,7 @@ class HTTPSitemapTests(SitemapTestsBase):
""" % self.base_url
self.assertXMLEqual(response.content.decode('utf-8'), expected_content)
- @ignore_warnings(category=RemovedInDjango110Warning)
def test_x_robots_sitemap(self):
- # 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.assertEqual(response['X-Robots-Tag'], 'noindex, noodp, noarchive')
diff --git a/tests/sitemaps_tests/test_https.py b/tests/sitemaps_tests/test_https.py
index b3bcdc172b..3b68baac43 100644
--- a/tests/sitemaps_tests/test_https.py
+++ b/tests/sitemaps_tests/test_https.py
@@ -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">