Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Fixed py3 compatibility for 5a00a57

  • Loading branch information...
commit 6bd61194d49219276275542662e2fbe690534555 1 parent 2cb48ff
@ptone ptone authored
View
2  django/views/generic/list.py
@@ -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):
View
3  tests/regressiontests/generic_views/list.py
@@ -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
@@ -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):
Please sign in to comment.
Something went wrong with that request. Please try again.