Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

[1.2.X] Fixed #14833 -- Skip the sitemaps localization test if i18n i…

…sn'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
  • Loading branch information...
commit 54b122c9bbe0c5957759db1d1a5454e09b71327f 1 parent b0d9eaa
@freakboy3742 freakboy3742 authored
Showing with 13 additions and 12 deletions.
  1. +13 −12 django/contrib/sitemaps/tests/basic.py
View
25 django/contrib/sitemaps/tests/basic.py
@@ -33,19 +33,20 @@ def test_simple_sitemap(self):
</urlset>
""" % date.today().strftime('%Y-%m-%d'))
- def test_localized_priority(self):
- "The priority value should not be localized (Refs #14164)"
- # Localization should be active
- settings.USE_L10N = True
- activate('fr')
- self.assertEqual(u'0,3', localize(0.3))
+ if settings.USE_I18N:
+ def test_localized_priority(self):
+ "The priority value should not be localized (Refs #14164)"
+ # Localization should be active
+ settings.USE_L10N = True
+ activate('fr')
+ self.assertEqual(u'0,3', localize(0.3))
- # Retrieve the sitemap. Check that priorities
- # haven't been rendered in localized format
- response = self.client.get('/simple/sitemap.xml')
- self.assertContains(response, '<priority>0.5</priority>')
- self.assertContains(response, '<lastmod>%s</lastmod>' % date.today().strftime('%Y-%m-%d'))
- deactivate()
+ # Retrieve the sitemap. Check that priorities
+ # haven't been rendered in localized format
+ response = self.client.get('/simple/sitemap.xml')
+ self.assertContains(response, '<priority>0.5</priority>')
+ self.assertContains(response, '<lastmod>%s</lastmod>' % date.today().strftime('%Y-%m-%d'))
+ deactivate()
def test_generic_sitemap(self):
"A minimal generic sitemap can be rendered"
Please sign in to comment.
Something went wrong with that request. Please try again.