summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarlton Gibson <carlton.gibson@noumenal.es>2019-01-16 16:19:56 +0100
committerGitHub <noreply@github.com>2019-01-16 16:19:56 +0100
commit876dc306cd508a041ccc62cf87397514fce4c9f3 (patch)
tree1bac91b1b1153b86c44512f6672976ec11985b73
parent181fb60159e54d442d3610f4afba6f066a6dac05 (diff)
Refs #30102 -- Added comment on use of Template without placeholders in page_not_found() view.
-rw-r--r--django/views/defaults.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/django/views/defaults.py b/django/views/defaults.py
index 6c394490ab..8bf60c9d74 100644
--- a/django/views/defaults.py
+++ b/django/views/defaults.py
@@ -52,6 +52,8 @@ def page_not_found(request, exception, template_name=ERROR_404_TEMPLATE_NAME):
if template_name != ERROR_404_TEMPLATE_NAME:
# Reraise if it's a missing custom template.
raise
+ # Render template (even though there are no substitutions) to allow
+ # inspecting the context in tests.
template = Engine().from_string(
'<h1>Not Found</h1>'
'<p>The requested resource was not found on this server.</p>')