mirror of
https://github.com/django/django.git
synced 2025-08-03 02:23:12 +00:00
Deprecated dirs argument to override TEMPLATE_DIRS.
Cancels 2f0566fa
. Refs #4278.
This commit is contained in:
parent
bcb693ebd4
commit
17012b6936
6 changed files with 68 additions and 36 deletions
|
@ -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')
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue