Opened 13 years ago

Closed 13 years ago

Last modified 13 years ago

#14833 closed (fixed)

Sitemaps tests fail if run from your project and USE_I18N is False

Reported by: Julien Phalip Owned by: nobody
Component: Contrib apps Version: 1.2
Severity: Keywords: sprintdec2010
Cc: Triage Stage: Unreviewed
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

Here's what you get:

FAIL: test_localized_priority (django.contrib.sitemaps.tests.basic.SitemapTests)
The priority value should not be localized (Refs #14164)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Users/julien/.virtualenvs/djangotests/src/django/django/contrib/sitemaps/tests/basic.py", line 45, in test_localized_priority
    self.assertEqual(u'0,3', localize(0.3))
AssertionError: u'0,3' != u'0.3'
- 0,3+ 0.3

Turning USE_I18N to True in setUp() doesn't work because it's already too late: the translations methods have already been loaded by then based on the project's settings. As discussed with Russ, the solution here is to simply skip the test.

Attachments (1)

14833_skip_sitemap_test.diff (885 bytes ) - added by Julien Phalip 13 years ago.

Download all attachments as: .zip

Change History (4)

by Julien Phalip, 13 years ago

comment:1 by Russell Keith-Magee, 13 years ago

Resolution: fixed
Status: newclosed

(In [14826]) Fixed #14833 -- Skip the sitemaps localization test if i18n isn't enabled. Thanks to Julien Phalip for the report and patch.

comment:2 by Russell Keith-Magee, 13 years ago

(In [14827]) [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.

comment:3 by Jacob, 13 years ago

milestone: 1.3

Milestone 1.3 deleted

Note: See TracTickets for help on using tickets.
Back to Top