Code

Opened 3 years ago

Closed 3 years ago

Last modified 2 years ago

#17488 closed Bug (fixed)

Failing WeekArchive tests

Reported by: apollo13 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 apollo13 3 years ago.

Download all attachments as: .zip

Change History (5)

Changed 3 years ago by apollo13

comment:1 Changed 3 years ago by aaugustin

  • Component changed from Uncategorized to Generic views
  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset
  • Triage Stage changed from Unreviewed to Accepted
  • Type changed from Uncategorized to Bug

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 Changed 3 years ago by aaugustin

  • Triage Stage changed from Accepted to Ready 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 Changed 3 years ago by aaugustin

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

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 Changed 2 years ago by ramiro

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.

Add Comment

Modify Ticket

Change Properties
<Author field>
Action
as closed
as The resolution will be set. Next status will be 'closed'
The resolution will be deleted. Next status will be 'new'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.