mirror of
https://github.com/django/django.git
synced 2025-07-06 10:49:17 +00:00
[1.2.X] Fixed #14833 -- Skip the sitemaps localization test if i18n isn't enabled. Thanks to Julien Phalip for the report and patch.
Backport of r14826 from trunk. git-svn-id: http://code.djangoproject.com/svn/django/branches/releases/1.2.X@14827 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
parent
b0d9eaaa6a
commit
54b122c9bb
@ -33,19 +33,20 @@ class SitemapTests(TestCase):
|
|||||||
</urlset>
|
</urlset>
|
||||||
""" % date.today().strftime('%Y-%m-%d'))
|
""" % date.today().strftime('%Y-%m-%d'))
|
||||||
|
|
||||||
def test_localized_priority(self):
|
if settings.USE_I18N:
|
||||||
"The priority value should not be localized (Refs #14164)"
|
def test_localized_priority(self):
|
||||||
# Localization should be active
|
"The priority value should not be localized (Refs #14164)"
|
||||||
settings.USE_L10N = True
|
# Localization should be active
|
||||||
activate('fr')
|
settings.USE_L10N = True
|
||||||
self.assertEqual(u'0,3', localize(0.3))
|
activate('fr')
|
||||||
|
self.assertEqual(u'0,3', localize(0.3))
|
||||||
|
|
||||||
# Retrieve the sitemap. Check that priorities
|
# Retrieve the sitemap. Check that priorities
|
||||||
# haven't been rendered in localized format
|
# haven't been rendered in localized format
|
||||||
response = self.client.get('/simple/sitemap.xml')
|
response = self.client.get('/simple/sitemap.xml')
|
||||||
self.assertContains(response, '<priority>0.5</priority>')
|
self.assertContains(response, '<priority>0.5</priority>')
|
||||||
self.assertContains(response, '<lastmod>%s</lastmod>' % date.today().strftime('%Y-%m-%d'))
|
self.assertContains(response, '<lastmod>%s</lastmod>' % date.today().strftime('%Y-%m-%d'))
|
||||||
deactivate()
|
deactivate()
|
||||||
|
|
||||||
def test_generic_sitemap(self):
|
def test_generic_sitemap(self):
|
||||||
"A minimal generic sitemap can be rendered"
|
"A minimal generic sitemap can be rendered"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user