Fixed py3 compatibility for 5a00a57aa5
This commit is contained in:
parent
2cb48fffd4
commit
6bd61194d4
|
@ -53,7 +53,7 @@ class MultipleObjectMixin(ContextMixin):
|
|||
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):
|
||||
|
|
|
@ -4,6 +4,7 @@ from django.core.exceptions import ImproperlyConfigured
|
|||
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 @@ class ListViewTests(TestCase):
|
|||
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):
|
||||
|
|
Loading…
Reference in New Issue