Fixed #12125 -- Fixed a typo in the generic views date_based test that caused it to fail in November. Thanks brutasse.
--This line and those below, will be ignored-- M tests/regressiontests/views/tests/generic/date_based.py git-svn-id: http://code.djangoproject.com/svn/django/trunk@11697 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
parent
e18af06eed
commit
ff38e0b1d1
|
@ -100,7 +100,7 @@ class MonthArchiveTest(TestCase):
|
||||||
|
|
||||||
now = datetime.now()
|
now = datetime.now()
|
||||||
prev_month = now.date().replace(day=1)
|
prev_month = now.date().replace(day=1)
|
||||||
if prev_month.month == 11:
|
if prev_month.month == 1:
|
||||||
prev_month = prev_month.replace(year=prev_month.year-1, month=12)
|
prev_month = prev_month.replace(year=prev_month.year-1, month=12)
|
||||||
else:
|
else:
|
||||||
prev_month = prev_month.replace(month=prev_month.month-1)
|
prev_month = prev_month.replace(month=prev_month.month-1)
|
||||||
|
@ -121,4 +121,4 @@ class DayArchiveTests(TestCase):
|
||||||
article = Article.objects.create(title="example", author=author, date_created=datetime(2004, 1, 21, 0, 0, 1))
|
article = Article.objects.create(title="example", author=author, date_created=datetime(2004, 1, 21, 0, 0, 1))
|
||||||
response = self.client.get('/views/date_based/archive_day/2004/1/21/')
|
response = self.client.get('/views/date_based/archive_day/2004/1/21/')
|
||||||
self.assertEqual(response.status_code, 200)
|
self.assertEqual(response.status_code, 200)
|
||||||
self.assertEqual(response.context['object_list'][0], article)
|
self.assertEqual(response.context['object_list'][0], article)
|
||||||
|
|
Loading…
Reference in New Issue