summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRamiro Morales <cramm0@gmail.com>2012-03-17 12:58:16 +0000
committerRamiro Morales <cramm0@gmail.com>2012-03-17 12:58:16 +0000
commit92929d5ef4ba555e2fedf683e8223ba748963538 (patch)
treee9e72630cf47ec4fa384d88b5fc1db221387d544
parent1dd8848bebfcf98ae688984c7686250f7956acb6 (diff)
[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. git-svn-id: http://code.djangoproject.com/svn/django/branches/releases/1.3.X@17759 bcc190cf-cafb-0310-a4f2-bffc1f526a37
-rw-r--r--tests/regressiontests/generic_views/dates.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/tests/regressiontests/generic_views/dates.py b/tests/regressiontests/generic_views/dates.py
index 5b784f6810..83658ca395 100644
--- a/tests/regressiontests/generic_views/dates.py
+++ b/tests/regressiontests/generic_views/dates.py
@@ -255,7 +255,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)