Opened 13 years ago

Closed 13 years ago

Last modified 13 years ago

#17488 closed Bug (fixed)

Failing WeekArchive tests

Reported by: Florian Apolloner Owned by: nobody
Component: Generic views Version: 1.3
Severity: Normal Keywords:
Cc: Triage Stage: Ready for checkin
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

As seen in: http://ci.django-cms.org/job/Django/database=sqlite3,python=python2.5/lastCompletedBuild/testReport/regressiontests.generic_views.dates/WeekArchiveViewTests/test_week_view_allow_future/

The problem is that 1.1.year is not necessarily in the first week -- it can be in week 0 (this is usually the case if the first day of the year is no sunday). Hence I attached a patch which checks for the 7.1.year which is always in the first week of the year.

Attachments (1)

fix.diff (707 bytes ) - added by Florian Apolloner 13 years ago.

Download all attachments as: .zip

Change History (5)

by Florian Apolloner, 13 years ago

Attachment: fix.diff added

comment:1 by Aymeric Augustin, 13 years ago

Component: UncategorizedGeneric views
Triage Stage: UnreviewedAccepted
Type: UncategorizedBug

http://en.wikipedia.org/wiki/ISO_8601#Week_dates says that a valid definition of week 1 is "the week with 4 January in it". So I'm going to use "4.1.year".

comment:2 by Aymeric Augustin, 13 years ago

Triage Stage: AcceptedReady for checkin

Actually, Python doesn't follow ISO here; the docs for strftime / strptime imply that week 1 starts on the first Sunday or Monday of the year. So 7 was correct.

comment:3 by Aymeric Augustin, 13 years ago

Resolution: fixed
Status: newclosed

In [17321]:

Fixed #17488 -- This test passed in 2011 only because 2012-01-01 is a Sunday. Thanks Florian Apolloner for the report and patch.

comment:4 by Ramiro Morales, 13 years ago

In [17759]:

[1.3.X] Fixed #17488 -- This test passed in 2011 only because 2012-01-01 is a Sunday. Thanks Florian Apolloner for the report and patch.

Fixes #17912. Thanks Julien for the report.

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