Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

[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
Russell Keith-Magee authored December 05, 2010

Showing 1 changed file with 13 additions and 12 deletions. Show diff stats Hide diff stats

  1. 25  django/contrib/sitemaps/tests/basic.py
25  django/contrib/sitemaps/tests/basic.py
@@ -33,19 +33,20 @@ def test_simple_sitemap(self):
33 33
 </urlset>
34 34
 """ % date.today().strftime('%Y-%m-%d'))
35 35
 
36  
-    def test_localized_priority(self):
37  
-        "The priority value should not be localized (Refs #14164)"
38  
-        # Localization should be active
39  
-        settings.USE_L10N = True
40  
-        activate('fr')
41  
-        self.assertEqual(u'0,3', localize(0.3))
  36
+    if settings.USE_I18N:
  37
+        def test_localized_priority(self):
  38
+            "The priority value should not be localized (Refs #14164)"
  39
+            # Localization should be active
  40
+            settings.USE_L10N = True
  41
+            activate('fr')
  42
+            self.assertEqual(u'0,3', localize(0.3))
42 43
 
43  
-        # Retrieve the sitemap. Check that priorities
44  
-        # haven't been rendered in localized format
45  
-        response = self.client.get('/simple/sitemap.xml')
46  
-        self.assertContains(response, '<priority>0.5</priority>')
47  
-        self.assertContains(response, '<lastmod>%s</lastmod>' % date.today().strftime('%Y-%m-%d'))
48  
-        deactivate()
  44
+            # Retrieve the sitemap. Check that priorities
  45
+            # haven't been rendered in localized format
  46
+            response = self.client.get('/simple/sitemap.xml')
  47
+            self.assertContains(response, '<priority>0.5</priority>')
  48
+            self.assertContains(response, '<lastmod>%s</lastmod>' % date.today().strftime('%Y-%m-%d'))
  49
+            deactivate()
49 50
 
50 51
     def test_generic_sitemap(self):
51 52
         "A minimal generic sitemap can be rendered"

0 notes on commit 54b122c

Please sign in to comment.
Something went wrong with that request. Please try again.