From b9910bddd268f211a5b97e98d912caaf5d4b257c Mon Sep 17 00:00:00 2001 From: Aymeric Augustin Date: Sun, 1 Jan 2012 20:59:09 +0000 Subject: [PATCH] Fixed #17488 -- This test passed in 2011 only because 2012-01-01 is a Sunday. Thanks Florian Apolloner for the report and patch. git-svn-id: http://code.djangoproject.com/svn/django/trunk@17321 bcc190cf-cafb-0310-a4f2-bffc1f526a37 --- tests/regressiontests/generic_views/dates.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/regressiontests/generic_views/dates.py b/tests/regressiontests/generic_views/dates.py index 5e03dbe806..652f66b7f1 100644 --- a/tests/regressiontests/generic_views/dates.py +++ b/tests/regressiontests/generic_views/dates.py @@ -257,7 +257,8 @@ class WeekArchiveViewTests(TestCase): self.assertEqual(list(res.context['book_list']), []) def test_week_view_allow_future(self): - future = datetime.date(datetime.date.today().year + 1, 1, 1) + # January 7th always falls in week 1, given Python's definition of week numbers + future = datetime.date(datetime.date.today().year + 1, 1, 7) b = Book.objects.create(name="The New New Testement", pages=600, pubdate=future) res = self.client.get('/dates/books/%s/week/1/' % future.year)