mirror of
https://github.com/django/django.git
synced 2025-07-24 05:36:15 +00:00
Cleaned up the django.template namespace.
Since this package is going to hold both the implementation of the Django Template Language and the infrastructure for Multiple Template Engines, it should be untied from the DTL as much as possible within our backwards-compatibility policy. Only public APIs (i.e. APIs mentioned in the documentation) were left.
This commit is contained in:
parent
bfa21ddf76
commit
7eefdbf7ab
11 changed files with 99 additions and 100 deletions
|
@ -6,7 +6,7 @@ import functools
|
|||
|
||||
from django import template
|
||||
from django.template import Library
|
||||
from django.template.base import Context
|
||||
from django.template.base import Context, libraries
|
||||
from django.template.engine import Engine
|
||||
from django.template.loader import get_template
|
||||
from django.test.utils import override_settings
|
||||
|
@ -100,9 +100,11 @@ def upper(value):
|
|||
def register_test_tags(func):
|
||||
@functools.wraps(func)
|
||||
def inner(self):
|
||||
template.libraries['testtags'] = register
|
||||
func(self)
|
||||
del template.libraries['testtags']
|
||||
libraries['testtags'] = register
|
||||
try:
|
||||
func(self)
|
||||
finally:
|
||||
del libraries['testtags']
|
||||
return inner
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue