summaryrefslogtreecommitdiff
path: root/tests/sitemaps_tests
diff options
context:
space:
mode:
authorMariusz Felisiak <felisiak.mariusz@gmail.com>2023-01-06 12:55:14 +0100
committerMariusz Felisiak <felisiak.mariusz@gmail.com>2023-01-17 11:49:15 +0100
commit4eb97a90f0b4484fb13dd2166a61f9fe7256e9d0 (patch)
tree2cc059396547f66cedc19c4e842d399dbe196fae /tests/sitemaps_tests
parent602d9a312facc64d44619c61c3863d3d0820006a (diff)
downloaddjango-4eb97a90f0b4484fb13dd2166a61f9fe7256e9d0.tar.gz
Refs #32375 -- Changed default sitemap protocol to https.
Per deprecation timeline.
Diffstat (limited to 'tests/sitemaps_tests')
-rw-r--r--tests/sitemaps_tests/test_generic.py16
-rw-r--r--tests/sitemaps_tests/test_http.py3
2 files changed, 2 insertions, 17 deletions
diff --git a/tests/sitemaps_tests/test_generic.py b/tests/sitemaps_tests/test_generic.py
index 2865c77902..dc998eec93 100644
--- a/tests/sitemaps_tests/test_generic.py
+++ b/tests/sitemaps_tests/test_generic.py
@@ -1,8 +1,7 @@
from datetime import datetime
from django.contrib.sitemaps import GenericSitemap
-from django.test import ignore_warnings, override_settings
-from django.utils.deprecation import RemovedInDjango50Warning
+from django.test import override_settings
from .base import SitemapTestsBase
from .models import TestModel
@@ -79,20 +78,9 @@ class GenericViewsSitemapTests(SitemapTestsBase):
with self.subTest(protocol=protocol):
self.assertEqual(sitemap.get_protocol(protocol), protocol)
- @ignore_warnings(category=RemovedInDjango50Warning)
def test_get_protocol_default(self):
sitemap = GenericSitemap({"queryset": None})
- self.assertEqual(sitemap.get_protocol(), "http")
-
- def test_get_protocol_default_warning(self):
- sitemap = GenericSitemap({"queryset": None})
- msg = (
- "The default sitemap protocol will be changed from 'http' to "
- "'https' in Django 5.0. Set Sitemap.protocol to silence this "
- "warning."
- )
- with self.assertWarnsMessage(RemovedInDjango50Warning, msg):
- sitemap.get_protocol()
+ self.assertEqual(sitemap.get_protocol(), "https")
def test_generic_sitemap_index(self):
TestModel.objects.update(lastmod=datetime(2013, 3, 13, 10, 0, 0))
diff --git a/tests/sitemaps_tests/test_http.py b/tests/sitemaps_tests/test_http.py
index 12e387757b..1a0c1c3d50 100644
--- a/tests/sitemaps_tests/test_http.py
+++ b/tests/sitemaps_tests/test_http.py
@@ -271,7 +271,6 @@ class HTTPSitemapTests(SitemapTestsBase):
) % date.today()
self.assertXMLEqual(response.content.decode(), expected_content)
- @ignore_warnings(category=RemovedInDjango50Warning)
def test_sitemap_get_urls_no_site_1(self):
"""
Check we get ImproperlyConfigured if we don't pass a site object to
@@ -282,7 +281,6 @@ class HTTPSitemapTests(SitemapTestsBase):
Sitemap().get_urls()
@modify_settings(INSTALLED_APPS={"remove": "django.contrib.sites"})
- @ignore_warnings(category=RemovedInDjango50Warning)
def test_sitemap_get_urls_no_site_2(self):
"""
Check we get ImproperlyConfigured when we don't pass a site object to
@@ -292,7 +290,6 @@ class HTTPSitemapTests(SitemapTestsBase):
with self.assertRaisesMessage(ImproperlyConfigured, self.use_sitemap_err_msg):
Sitemap().get_urls()
- @ignore_warnings(category=RemovedInDjango50Warning)
def test_sitemap_item(self):
"""
Check to make sure that the raw item is included with each