summaryrefslogtreecommitdiff
path: root/tests/shortcuts/tests.py
diff options
context:
space:
mode:
authorAymeric Augustin <aymeric.augustin@m4x.org>2015-01-03 19:28:15 +0100
committerAymeric Augustin <aymeric.augustin@m4x.org>2015-01-07 21:54:22 +0100
commit127f9e073d83904defd4bde4eaa4491f3306ca25 (patch)
tree29517d65351d6390d386f4579ee86f53ad0985ce /tests/shortcuts/tests.py
parenteaa1a22341aef5b92f5c3cd682f01e61c4159262 (diff)
Restored support for multiple template names in render(_to_response).
This possibility was documented but not tested. It had been broken during the multiple template engines refactor.
Diffstat (limited to 'tests/shortcuts/tests.py')
-rw-r--r--tests/shortcuts/tests.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/tests/shortcuts/tests.py b/tests/shortcuts/tests.py
index 612f4a3dd8..f5351dfa03 100644
--- a/tests/shortcuts/tests.py
+++ b/tests/shortcuts/tests.py
@@ -14,6 +14,11 @@ class ShortcutTests(TestCase):
self.assertEqual(response.content, b'FOO.BAR..\n')
self.assertEqual(response['Content-Type'], 'text/html; charset=utf-8')
+ def test_render_to_response_with_multiple_templates(self):
+ response = self.client.get('/render_to_response/multiple_templates/')
+ self.assertEqual(response.status_code, 200)
+ self.assertEqual(response.content, b'FOO.BAR..\n')
+
@ignore_warnings(category=RemovedInDjango20Warning)
def test_render_to_response_with_request_context(self):
response = self.client.get('/render_to_response/request_context/')
@@ -51,6 +56,11 @@ class ShortcutTests(TestCase):
self.assertEqual(response['Content-Type'], 'text/html; charset=utf-8')
self.assertFalse(hasattr(response.context.request, 'current_app'))
+ def test_render_with_multiple_templates(self):
+ response = self.client.get('/render/multiple_templates/')
+ self.assertEqual(response.status_code, 200)
+ self.assertEqual(response.content, b'FOO.BAR../path/to/static/media/\n')
+
@ignore_warnings(category=RemovedInDjango20Warning)
def test_render_with_base_context(self):
response = self.client.get('/render/base_context/')