summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPreston Timmons <prestontimmons@gmail.com>2015-02-23 15:30:05 -0600
committerTim Graham <timograham@gmail.com>2015-02-24 09:22:25 -0500
commit450b42eafe46bd3df916f94c7274e0d6ae8ca029 (patch)
tree6fb3c9302b6dbdb94acd37404103da40042c4be1
parentb22d20dd182f5510d9fcf00395abb13be36ae339 (diff)
[1.8.x] Cleaned up template directory handling in template tests.
Backport of 8e129b42ad9c9adca599228ae2ad68271fa46d44 from master
-rw-r--r--tests/template_tests/test_response.py6
-rw-r--r--tests/template_tests/tests.py4
2 files changed, 3 insertions, 7 deletions
diff --git a/tests/template_tests/test_response.py b/tests/template_tests/test_response.py
index af516e90be..22863b49fc 100644
--- a/tests/template_tests/test_response.py
+++ b/tests/template_tests/test_response.py
@@ -1,6 +1,5 @@
from __future__ import unicode_literals
-import os
import pickle
import time
from datetime import datetime
@@ -14,9 +13,10 @@ from django.test import (
RequestFactory, SimpleTestCase, ignore_warnings, override_settings,
)
from django.test.utils import require_jinja2
-from django.utils._os import upath
from django.utils.deprecation import RemovedInDjango20Warning
+from .utils import TEMPLATE_DIR
+
def test_processor(request):
return {'processors': 'yes'}
@@ -224,7 +224,7 @@ class SimpleTemplateResponseTest(SimpleTestCase):
@override_settings(TEMPLATES=[{
'BACKEND': 'django.template.backends.django.DjangoTemplates',
- 'DIRS': [os.path.join(os.path.dirname(upath(__file__)), 'templates')],
+ 'DIRS': [TEMPLATE_DIR],
'OPTIONS': {
'context_processors': [test_processor_name],
},
diff --git a/tests/template_tests/tests.py b/tests/template_tests/tests.py
index 9f2726753d..9460cc3f1d 100644
--- a/tests/template_tests/tests.py
+++ b/tests/template_tests/tests.py
@@ -1,7 +1,6 @@
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
-import os
import sys
from django.contrib.auth.models import Group
@@ -10,9 +9,6 @@ from django.template import (
Context, Template, TemplateSyntaxError, engines, loader,
)
from django.test import SimpleTestCase, override_settings
-from django.utils._os import upath
-
-TEMPLATES_DIR = os.path.join(os.path.dirname(upath(__file__)), 'templates')
class TemplateTests(SimpleTestCase):