give a hint when a page is missing (#27031)
This commit is contained in:
parent
58ed3bb9cc
commit
0c7b57fad0
|
@ -423,7 +423,7 @@ def page(request):
|
|||
redirect = Redirect.objects.filter(old_url=url).last()
|
||||
if redirect:
|
||||
return HttpResponseRedirect(redirect.page.get_online_url())
|
||||
raise Http404()
|
||||
raise Http404("combo: can't find the requested page, you might need to create it.")
|
||||
|
||||
return publish_page(request, page)
|
||||
|
||||
|
|
|
@ -276,6 +276,11 @@ def test_404(app):
|
|||
resp = app.get('/foobar/', status=404)
|
||||
assert 'Custom 404 Text' in resp.text
|
||||
|
||||
with override_settings(DEBUG=True):
|
||||
# check error page provides an hint when debugging
|
||||
resp = app.get('/foobar/', status=404)
|
||||
assert "can't find the requested page" in resp.text
|
||||
|
||||
def test_style_demo(app, admin_user):
|
||||
TextCell.objects.all().delete()
|
||||
Page.objects.all().delete()
|
||||
|
|
Loading…
Reference in New Issue