1
0
mirror of https://github.com/django/django.git synced 2025-10-31 09:41:08 +00:00

adds fix and test for when a template is not specified at all to render(). fixes #21058. by jambonrose and ianawilson

This commit is contained in:
Ian Wilson
2013-09-06 15:50:18 -05:00
parent 630eb0564a
commit 9b7f4aab32
5 changed files with 21 additions and 0 deletions

View File

@@ -14,6 +14,9 @@ from unittest import skipIf
from django.core import mail
from django.core.files.uploadedfile import SimpleUploadedFile
from django.core.urlresolvers import reverse
from django.http import HttpRequest
from django.shortcuts import render
from django.template.base import TemplateDoesNotExist
from django.test import TestCase, RequestFactory
from django.test.utils import (override_settings, setup_test_template_loader,
restore_template_loaders)
@@ -129,6 +132,12 @@ class DebugViewTests(TestCase):
finally:
shutil.rmtree(template_path)
def test_no_template_source_loaders(self):
"""
Make sure if you don't specify a template, the debug view doesn't blow up.
"""
self.assertRaises(TemplateDoesNotExist, self.client.get, '/render_no_template/')
class ExceptionReporterTests(TestCase):
rf = RequestFactory()