summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorAlex Gaynor <alex.gaynor@rd.io>2012-11-04 15:58:54 -0800
committerAlex Gaynor <alex.gaynor@rd.io>2012-11-04 15:58:54 -0800
commitd35b95c2f45bc5bc91deab12e503b04126fe70d7 (patch)
treed0a2900d1a8a9d75bee1c5912cb0ae3fa948d000 /tests
parentd828d4e186b5433f637b86c4e44a3b68acab5cb8 (diff)
parentb85cb92ba97a67cd6e0893be05ffbc6c65b4f83f (diff)
Merge branch 'stable/1.5.x' of https://github.com/django/django into stable/1.5.x
Diffstat (limited to 'tests')
-rw-r--r--tests/regressiontests/generic_views/list.py12
1 files changed, 11 insertions, 1 deletions
diff --git a/tests/regressiontests/generic_views/list.py b/tests/regressiontests/generic_views/list.py
index 14dc1d725d..6c73138043 100644
--- a/tests/regressiontests/generic_views/list.py
+++ b/tests/regressiontests/generic_views/list.py
@@ -2,6 +2,7 @@ from __future__ import absolute_import
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 .models import Author, Artist
@@ -171,8 +172,17 @@ class ListViewTests(TestCase):
with self.assertNumQueries(3):
self.client.get('/list/authors/notempty/paginated/')
+ @override_settings(DEBUG=True)
+ def test_paginated_list_view_returns_useful_message_on_invalid_page(self):
+ # test for #19240
+ # tests that source exception's message is included in page
+ self._make_authors(1)
+ res = self.client.get('/list/authors/paginated/2/')
+ self.assertEqual(res.status_code, 404)
+ self.assertEqual(res.context.get('reason'),
+ "Invalid page (2): That page contains no results")
+
def _make_authors(self, n):
Author.objects.all().delete()
for i in range(n):
Author.objects.create(name='Author %02i' % i, slug='a%s' % i)
-