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

[1.7.x] Avoided using private API get_template_from_string.

Conflicts:
	django/contrib/webdesign/tests.py

Backport of c0c1bb9e from master.
This commit is contained in:
Aymeric Augustin
2014-10-31 11:38:53 +01:00
parent 31d1ccca3f
commit 12bace46c1
4 changed files with 12 additions and 17 deletions

View File

@@ -9,7 +9,7 @@ import sys
import tempfile
import unittest
from django.template import loader, Context
from django.template import Context, Template
from django.conf import settings
from django.core.cache.backends.base import BaseCache
from django.core.exceptions import ImproperlyConfigured
@@ -89,7 +89,7 @@ class BaseStaticFilesTestCase(object):
def render_template(self, template, **kwargs):
if isinstance(template, six.string_types):
template = loader.get_template_from_string(template)
template = Template(template)
return template.render(Context(kwargs)).strip()
def static_template_snippet(self, path, asvar=False):