summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorAymeric Augustin <aymeric.augustin@m4x.org>2014-11-13 20:25:08 +0100
committerAymeric Augustin <aymeric.augustin@m4x.org>2014-11-23 09:29:33 +0100
commit17012b6936128fb771b98e4fa6d78caddd07a9a8 (patch)
treeb662345113691bc30944eec4f12a39400cec908b /tests
parentbcb693ebd4d3743cb194c6fd05b2d70fb9696a4c (diff)
Deprecated dirs argument to override TEMPLATE_DIRS.
Cancels 2f0566fa. Refs #4278.
Diffstat (limited to 'tests')
-rw-r--r--tests/shortcuts/tests.py10
-rw-r--r--tests/template_tests/test_loaders.py3
2 files changed, 10 insertions, 3 deletions
diff --git a/tests/shortcuts/tests.py b/tests/shortcuts/tests.py
index 24a73d4ffd..2b55326311 100644
--- a/tests/shortcuts/tests.py
+++ b/tests/shortcuts/tests.py
@@ -1,3 +1,5 @@
+import warnings
+from django.utils.deprecation import RemovedInDjango20Warning
from django.test import TestCase, override_settings
@@ -27,7 +29,9 @@ class ShortcutTests(TestCase):
self.assertEqual(response['Content-Type'], 'application/x-rendertest')
def test_render_to_response_with_dirs(self):
- response = self.client.get('/render_to_response/dirs/')
+ with warnings.catch_warnings():
+ warnings.filterwarnings("ignore", category=RemovedInDjango20Warning)
+ response = self.client.get('/render_to_response/dirs/')
self.assertEqual(response.status_code, 200)
self.assertEqual(response.content, b'spam eggs\n')
self.assertEqual(response['Content-Type'], 'text/html; charset=utf-8')
@@ -70,7 +74,9 @@ class ShortcutTests(TestCase):
self.assertEqual(response.context.current_app, "foobar_app")
def test_render_with_dirs(self):
- response = self.client.get('/render/dirs/')
+ with warnings.catch_warnings():
+ warnings.filterwarnings("ignore", category=RemovedInDjango20Warning)
+ response = self.client.get('/render/dirs/')
self.assertEqual(response.status_code, 200)
self.assertEqual(response.content, b'spam eggs\n')
self.assertEqual(response['Content-Type'], 'text/html; charset=utf-8')
diff --git a/tests/template_tests/test_loaders.py b/tests/template_tests/test_loaders.py
index c3c086f381..220f766077 100644
--- a/tests/template_tests/test_loaders.py
+++ b/tests/template_tests/test_loaders.py
@@ -25,6 +25,7 @@ from django.template.loaders.eggs import Loader as EggLoader
from django.template.loaders.utils import find_template_loader
from django.template import loader
from django.test import TestCase, override_settings
+from django.test.utils import IgnorePendingDeprecationWarningsMixin
from django.utils import six
from django.utils._os import upath
from django.utils.six import StringIO
@@ -185,7 +186,7 @@ class RenderToStringTest(TestCase):
loader.render_to_string('test_context_stack.html', context_instance=Context()).strip())
-class TemplateDirsOverrideTest(unittest.TestCase):
+class TemplateDirsOverrideTest(IgnorePendingDeprecationWarningsMixin, unittest.TestCase):
dirs_tuple = (os.path.join(os.path.dirname(upath(__file__)), 'other_templates'),)
dirs_list = list(dirs_tuple)