Fixed py3 compatibility for 5a00a57aa5

This commit is contained in:
Preston Holmes 2012-11-04 23:38:41 -08:00
parent 2cb48fffd4
commit 6bd61194d4
2 changed files with 3 additions and 2 deletions

View File

@ -53,7 +53,7 @@ class MultipleObjectMixin(ContextMixin):
except InvalidPage as e: except InvalidPage as e:
raise Http404(_('Invalid page (%(page_number)s): %(message)s') % { raise Http404(_('Invalid page (%(page_number)s): %(message)s') % {
'page_number': page_number, 'page_number': page_number,
'message': e.message, 'message': str(e)
}) })
def get_paginate_by(self, queryset): def get_paginate_by(self, queryset):

View File

@ -4,6 +4,7 @@ from django.core.exceptions import ImproperlyConfigured
from django.test import TestCase from django.test import TestCase
from django.test.utils import override_settings from django.test.utils import override_settings
from django.views.generic.base import View from django.views.generic.base import View
from django.utils.encoding import force_str
from .models import Author, Artist from .models import Author, Artist
@ -179,7 +180,7 @@ class ListViewTests(TestCase):
self._make_authors(1) self._make_authors(1)
res = self.client.get('/list/authors/paginated/2/') res = self.client.get('/list/authors/paginated/2/')
self.assertEqual(res.status_code, 404) 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") "Invalid page (2): That page contains no results")
def _make_authors(self, n): def _make_authors(self, n):