From 54b122c9bbe0c5957759db1d1a5454e09b71327f Mon Sep 17 00:00:00 2001 From: Russell Keith-Magee Date: Sun, 5 Dec 2010 02:09:29 +0000 Subject: [PATCH] [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 --- django/contrib/sitemaps/tests/basic.py | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/django/contrib/sitemaps/tests/basic.py b/django/contrib/sitemaps/tests/basic.py index 70e28c2f74..a47f4d8979 100644 --- a/django/contrib/sitemaps/tests/basic.py +++ b/django/contrib/sitemaps/tests/basic.py @@ -33,19 +33,20 @@ class SitemapTests(TestCase): """ % 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, '0.5') - self.assertContains(response, '%s' % 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, '0.5') + self.assertContains(response, '%s' % date.today().strftime('%Y-%m-%d')) + deactivate() def test_generic_sitemap(self): "A minimal generic sitemap can be rendered"