Skip to content

Commit

Permalink
[1.5.x] Fixed py3 compatibility for 5a00a57
Browse files Browse the repository at this point in the history
  • Loading branch information
ptone committed Nov 5, 2012
1 parent 81342c2 commit c7d5e7c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion django/views/generic/list.py
Expand Up @@ -53,7 +53,7 @@ def paginate_queryset(self, queryset, page_size):
except InvalidPage as e:
raise Http404(_('Invalid page (%(page_number)s): %(message)s') % {
'page_number': page_number,
'message': e.message,
'message': str(e)
})

def get_paginate_by(self, queryset):
Expand Down
3 changes: 2 additions & 1 deletion tests/regressiontests/generic_views/list.py
Expand Up @@ -4,6 +4,7 @@
from django.test import TestCase
from django.test.utils import override_settings
from django.views.generic.base import View
from django.utils.encoding import force_str

from .models import Author, Artist

Expand Down Expand Up @@ -179,7 +180,7 @@ def test_paginated_list_view_returns_useful_message_on_invalid_page(self):
self._make_authors(1)
res = self.client.get('/list/authors/paginated/2/')
self.assertEqual(res.status_code, 404)
self.assertEqual(res.context.get('reason'),
self.assertEqual(force_str(res.context.get('reason')),
"Invalid page (2): That page contains no results")

def _make_authors(self, n):
Expand Down

0 comments on commit c7d5e7c

Please sign in to comment.