Author: russellm Date: 2010-12-04 20:09:29 -0600 (Sat, 04 Dec 2010) New Revision: 14827
Modified: django/branches/releases/1.2.X/django/contrib/sitemaps/tests/basic.py Log: [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. Modified: django/branches/releases/1.2.X/django/contrib/sitemaps/tests/basic.py =================================================================== --- django/branches/releases/1.2.X/django/contrib/sitemaps/tests/basic.py 2010-12-05 02:07:46 UTC (rev 14826) +++ django/branches/releases/1.2.X/django/contrib/sitemaps/tests/basic.py 2010-12-05 02:09:29 UTC (rev 14827) @@ -33,19 +33,20 @@ </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" -- You received this message because you are subscribed to the Google Groups "Django updates" group. To post to this group, send email to django-upda...@googlegroups.com. To unsubscribe from this group, send email to django-updates+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-updates?hl=en.