diff options
| author | Rohith PR <praroh2@gmail.com> | 2021-05-15 11:41:14 +0530 |
|---|---|---|
| committer | Mariusz Felisiak <felisiak.mariusz@gmail.com> | 2021-05-21 11:00:54 +0200 |
| commit | 7cca22964c09e8dafc313a400c428242404d527a (patch) | |
| tree | cd6cbeaca8f3c95196e9ccd910f3dff443086763 /tests/sitemaps_tests/test_http.py | |
| parent | 56003b21eae3813e93fdd74f2b206d91e566bb27 (diff) | |
Fixed #32375 -- Started deprecation toward changing the default sitemap protocol to https.
The default sitemap protocol, when it is built outside the context of
a request, will be changed from 'http' to 'https' in Django 5.0.
Diffstat (limited to 'tests/sitemaps_tests/test_http.py')
| -rw-r--r-- | tests/sitemaps_tests/test_http.py | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/tests/sitemaps_tests/test_http.py b/tests/sitemaps_tests/test_http.py index fadf88eb60..5dffe4017d 100644 --- a/tests/sitemaps_tests/test_http.py +++ b/tests/sitemaps_tests/test_http.py @@ -4,8 +4,9 @@ from datetime import date from django.contrib.sitemaps import Sitemap from django.contrib.sites.models import Site from django.core.exceptions import ImproperlyConfigured -from django.test import modify_settings, override_settings +from django.test import ignore_warnings, modify_settings, override_settings from django.utils import translation +from django.utils.deprecation import RemovedInDjango50Warning from django.utils.formats import localize from .base import SitemapTestsBase @@ -197,6 +198,7 @@ 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 @@ -207,6 +209,7 @@ 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 @@ -216,6 +219,7 @@ 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 |
