Loading tests/regressiontests/generic_views/dates.py +7 −0 Original line number Diff line number Diff line Loading @@ -446,6 +446,13 @@ class DayArchiveViewTests(TestCase): self.assertEqual(res.context['next_day'], future) self.assertEqual(res.context['previous_day'], datetime.date(2006, 5, 1)) # allow_future for yesterday, next_day is today (#17192) today = datetime.date.today() yesterday = today - datetime.timedelta(days=1) res = self.client.get('/dates/books/%s/allow_empty_and_future/' % yesterday.strftime('%Y/%b/%d').lower()) self.assertEqual(res.context['next_day'], today) def test_day_view_paginated(self): res = self.client.get('/dates/books/2008/oct/1/') self.assertEqual(res.status_code, 200) Loading tests/regressiontests/generic_views/urls.py +2 −0 Original line number Diff line number Diff line Loading @@ -204,6 +204,8 @@ urlpatterns = patterns('', views.BookDayArchive.as_view(allow_empty=True)), (r'^dates/books/(?P<year>\d{4})/(?P<month>[a-z]{3})/(?P<day>\d{1,2})/allow_future/$', views.BookDayArchive.as_view(allow_future=True)), (r'^dates/books/(?P<year>\d{4})/(?P<month>[a-z]{3})/(?P<day>\d{1,2})/allow_empty_and_future/$', views.BookDayArchive.as_view(allow_empty=True, allow_future=True)), (r'^dates/books/(?P<year>\d{4})/(?P<month>[a-z]{3})/(?P<day>\d{1,2})/paginated/$', views.BookDayArchive.as_view(paginate_by=True)), (r'^dates/books/(?P<year>\d{4})/(?P<month>[a-z]{3})/no_day/$', Loading Loading
tests/regressiontests/generic_views/dates.py +7 −0 Original line number Diff line number Diff line Loading @@ -446,6 +446,13 @@ class DayArchiveViewTests(TestCase): self.assertEqual(res.context['next_day'], future) self.assertEqual(res.context['previous_day'], datetime.date(2006, 5, 1)) # allow_future for yesterday, next_day is today (#17192) today = datetime.date.today() yesterday = today - datetime.timedelta(days=1) res = self.client.get('/dates/books/%s/allow_empty_and_future/' % yesterday.strftime('%Y/%b/%d').lower()) self.assertEqual(res.context['next_day'], today) def test_day_view_paginated(self): res = self.client.get('/dates/books/2008/oct/1/') self.assertEqual(res.status_code, 200) Loading
tests/regressiontests/generic_views/urls.py +2 −0 Original line number Diff line number Diff line Loading @@ -204,6 +204,8 @@ urlpatterns = patterns('', views.BookDayArchive.as_view(allow_empty=True)), (r'^dates/books/(?P<year>\d{4})/(?P<month>[a-z]{3})/(?P<day>\d{1,2})/allow_future/$', views.BookDayArchive.as_view(allow_future=True)), (r'^dates/books/(?P<year>\d{4})/(?P<month>[a-z]{3})/(?P<day>\d{1,2})/allow_empty_and_future/$', views.BookDayArchive.as_view(allow_empty=True, allow_future=True)), (r'^dates/books/(?P<year>\d{4})/(?P<month>[a-z]{3})/(?P<day>\d{1,2})/paginated/$', views.BookDayArchive.as_view(paginate_by=True)), (r'^dates/books/(?P<year>\d{4})/(?P<month>[a-z]{3})/no_day/$', Loading