From 53d68af9cd893c6bf59ca47813f08343058290bf Mon Sep 17 00:00:00 2001 From: Henrik Levkowetz Date: Mon, 28 Nov 2016 21:05:17 +0000 Subject: [PATCH] Adapted the utils template tests to the new template handling in Django 1.8. - Legacy-Id: 12407 --- ietf/utils/tests.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/ietf/utils/tests.py b/ietf/utils/tests.py index bafc8b2c5..d0c4ca602 100644 --- a/ietf/utils/tests.py +++ b/ietf/utils/tests.py @@ -13,10 +13,10 @@ from email.mime.multipart import MIMEMultipart from django.conf import settings from django.core.management import call_command -from django.template import Context +from django.template import Context, engines from django.template.defaulttags import URLNode +from django.template.loader import get_template from django.templatetags.static import StaticNode -from django.template.loaders.filesystem import Loader from django.test import TestCase import debug # pyflakes:ignore @@ -109,12 +109,12 @@ class TemplateChecksTestCase(TestCase): templates = {} def setUp(self): - self.loader = Loader() self.paths = list(get_template_paths()) self.paths.sort() + self.engine = engines['django'] for path in self.paths: try: - self.templates[path], _ = self.loader.load_template(path) + self.templates[path] = get_template(path).template except Exception: pass @@ -126,7 +126,7 @@ class TemplateChecksTestCase(TestCase): for path in self.paths: if not path in self.templates: try: - self.loader.load_template(path) + get_template(path) except Exception as e: errors.append((path, e)) if errors: