Opened 5 years ago

Closed 5 years ago

Last modified 4 years ago

#14833 closed (fixed)

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

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

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 5 years ago.

Download all attachments as: .zip

Change History (4)

Changed 5 years ago by julien

comment:1 Changed 5 years ago by russellm

  • Resolution set to fixed
  • Status changed from new to closed

(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 Changed 5 years ago by russellm

(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 Changed 4 years ago by jacob

  • milestone 1.3 deleted

Milestone 1.3 deleted

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