mirror of
https://github.com/django/django.git
synced 2025-11-01 20:31:40 +00:00
Fixed #6262 -- Added a cached template loader, and modified existing template loaders and tag to be cacheable. Thanks to Mike Malone for the patch.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@11862 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
parent
5a235050b6
commit
44b9076bbe
23 changed files with 666 additions and 193 deletions
|
|
@ -10,6 +10,7 @@ from django.test.utils import ContextList
|
|||
from django.core.urlresolvers import reverse
|
||||
from django.core.exceptions import SuspiciousOperation
|
||||
from django.template import TemplateDoesNotExist, TemplateSyntaxError, Context
|
||||
from django.template import loader
|
||||
|
||||
class AssertContainsTests(TestCase):
|
||||
def setUp(self):
|
||||
|
|
@ -436,6 +437,11 @@ class ExceptionTests(TestCase):
|
|||
|
||||
class TemplateExceptionTests(TestCase):
|
||||
def setUp(self):
|
||||
# Reset the loaders so they don't try to render cached templates.
|
||||
if loader.template_source_loaders is not None:
|
||||
for template_loader in loader.template_source_loaders:
|
||||
if hasattr(template_loader, 'reset'):
|
||||
template_loader.reset()
|
||||
self.old_templates = settings.TEMPLATE_DIRS
|
||||
settings.TEMPLATE_DIRS = ()
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue