Refs #25916 -- Isolated sitemap.test_utils tests
This commit is contained in:
parent
2ccc0b22db
commit
2ce03a2bac
|
@ -12,6 +12,7 @@ from .base import SitemapTestsBase
|
|||
|
||||
class PingGoogleTests(SitemapTestsBase):
|
||||
|
||||
@override_settings(ROOT_URLCONF='sitemaps_tests.urls.sitemap_only')
|
||||
@mock.patch('django.contrib.sitemaps.urlopen')
|
||||
def test_something(self, urlopen):
|
||||
ping_google()
|
||||
|
@ -19,6 +20,7 @@ class PingGoogleTests(SitemapTestsBase):
|
|||
full_url = 'https://www.google.com/webmasters/tools/ping?%s' % params
|
||||
urlopen.assert_called_with(full_url)
|
||||
|
||||
@override_settings(ROOT_URLCONF='sitemaps_tests.urls.sitemap_only')
|
||||
def test_get_sitemap_full_url_global(self):
|
||||
self.assertEqual(_get_sitemap_full_url(None), 'https://example.com/sitemap-without-entries/sitemap.xml')
|
||||
|
||||
|
|
|
@ -0,0 +1,9 @@
|
|||
from django.contrib.sitemaps import views
|
||||
from django.urls import path
|
||||
|
||||
urlpatterns = [
|
||||
path(
|
||||
'sitemap-without-entries/sitemap.xml', views.sitemap,
|
||||
{'sitemaps': {}}, name='django.contrib.sitemaps.views.sitemap',
|
||||
),
|
||||
]
|
Loading…
Reference in New Issue