diff options
| author | Aymeric Augustin <aymeric.augustin@m4x.org> | 2014-12-17 22:51:42 +0100 |
|---|---|---|
| committer | Aymeric Augustin <aymeric.augustin@m4x.org> | 2014-12-28 17:02:30 +0100 |
| commit | d3205e3e2eb0202e7bdffaee3e2a80ad444b1ca2 (patch) | |
| tree | 11cc72ef84a3c35a5736de34b01bd52106fce08f /tests/view_tests | |
| parent | cf0fd65ed42d5d4f0585da413db4b1cf7c6b0d1a (diff) | |
Deprecated TEMPLATE_DIRS.
Diffstat (limited to 'tests/view_tests')
| -rw-r--r-- | tests/view_tests/tests/test_debug.py | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/tests/view_tests/tests/test_debug.py b/tests/view_tests/tests/test_debug.py index ab04c6622d..c0026fa758 100644 --- a/tests/view_tests/tests/test_debug.py +++ b/tests/view_tests/tests/test_debug.py @@ -145,7 +145,10 @@ class DebugViewTests(TestCase): with NamedTemporaryFile(prefix=template_name) as tempfile: tempdir = os.path.dirname(tempfile.name) template_path = os.path.join(tempdir, template_name) - with override_settings(TEMPLATE_DIRS=(tempdir,)): + with override_settings(TEMPLATES=[{ + 'BACKEND': 'django.template.backends.django.DjangoTemplates', + 'DIRS': [tempdir], + }]): response = self.client.get(reverse('raises_template_does_not_exist', kwargs={"path": template_name})) self.assertContains(response, "%s (File does not exist)" % template_path, status_code=500, count=1) @@ -157,7 +160,10 @@ class DebugViewTests(TestCase): tempdir = os.path.dirname(tempfile.name) template_path = os.path.join(tempdir, template_name) os.chmod(template_path, 0o0222) - with override_settings(TEMPLATE_DIRS=(tempdir,)): + with override_settings(TEMPLATES=[{ + 'BACKEND': 'django.template.backends.django.DjangoTemplates', + 'DIRS': [tempdir], + }]): response = self.client.get(reverse('raises_template_does_not_exist', kwargs={"path": template_name})) self.assertContains(response, "%s (File is not readable)" % template_path, status_code=500, count=1) @@ -167,7 +173,10 @@ class DebugViewTests(TestCase): template_path = mkdtemp() template_name = os.path.basename(template_path) tempdir = os.path.dirname(template_path) - with override_settings(TEMPLATE_DIRS=(tempdir,)): + with override_settings(TEMPLATES=[{ + 'BACKEND': 'django.template.backends.django.DjangoTemplates', + 'DIRS': [tempdir], + }]): response = self.client.get(reverse('raises_template_does_not_exist', kwargs={"path": template_name})) self.assertContains(response, "%s (Not a file)" % template_path, status_code=500, count=1) finally: |
