summaryrefslogtreecommitdiff
path: root/tests/shortcuts
diff options
context:
space:
mode:
authorAymeric Augustin <aymeric.augustin@m4x.org>2015-01-12 22:31:44 +0100
committerAymeric Augustin <aymeric.augustin@m4x.org>2015-01-12 22:31:44 +0100
commit5f7230e12f0d237cdc19d8930006b0fc7d9dbaa6 (patch)
tree3780335d2abb7d5e760c8ef7ac4819ba6e154574 /tests/shortcuts
parent511a53b3142551a1bc3093ed1b6655f57634f510 (diff)
downloaddjango-5f7230e12f0d237cdc19d8930006b0fc7d9dbaa6.tar.gz
Fixed #24124 (again) -- Updated tests with new default context_processors.
Thanks Collin for the review.
Diffstat (limited to 'tests/shortcuts')
-rw-r--r--tests/shortcuts/templates/shortcuts/render_test.html2
-rw-r--r--tests/shortcuts/tests.py11
2 files changed, 6 insertions, 7 deletions
diff --git a/tests/shortcuts/templates/shortcuts/render_test.html b/tests/shortcuts/templates/shortcuts/render_test.html
index 1b2f47a0e3..c2bbd9aa79 100644
--- a/tests/shortcuts/templates/shortcuts/render_test.html
+++ b/tests/shortcuts/templates/shortcuts/render_test.html
@@ -1 +1 @@
-{{ foo }}.{{ bar }}.{{ baz }}.{{ STATIC_URL }}
+{{ foo }}.{{ bar }}.{{ baz }}.{{ request.path }}
diff --git a/tests/shortcuts/tests.py b/tests/shortcuts/tests.py
index f5351dfa03..e22cf4d386 100644
--- a/tests/shortcuts/tests.py
+++ b/tests/shortcuts/tests.py
@@ -3,7 +3,6 @@ from django.test import TestCase, ignore_warnings, override_settings
@override_settings(
- STATIC_URL='/path/to/static/media/',
ROOT_URLCONF='shortcuts.urls',
)
class ShortcutTests(TestCase):
@@ -23,7 +22,7 @@ class ShortcutTests(TestCase):
def test_render_to_response_with_request_context(self):
response = self.client.get('/render_to_response/request_context/')
self.assertEqual(response.status_code, 200)
- self.assertEqual(response.content, b'FOO.BAR../path/to/static/media/\n')
+ self.assertEqual(response.content, b'FOO.BAR../render_to_response/request_context/\n')
self.assertEqual(response['Content-Type'], 'text/html; charset=utf-8')
def test_render_to_response_with_content_type(self):
@@ -52,14 +51,14 @@ class ShortcutTests(TestCase):
def test_render(self):
response = self.client.get('/render/')
self.assertEqual(response.status_code, 200)
- self.assertEqual(response.content, b'FOO.BAR../path/to/static/media/\n')
+ self.assertEqual(response.content, b'FOO.BAR../render/\n')
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')
+ self.assertEqual(response.content, b'FOO.BAR../render/multiple_templates/\n')
@ignore_warnings(category=RemovedInDjango20Warning)
def test_render_with_base_context(self):
@@ -71,13 +70,13 @@ class ShortcutTests(TestCase):
def test_render_with_content_type(self):
response = self.client.get('/render/content_type/')
self.assertEqual(response.status_code, 200)
- self.assertEqual(response.content, b'FOO.BAR../path/to/static/media/\n')
+ self.assertEqual(response.content, b'FOO.BAR../render/content_type/\n')
self.assertEqual(response['Content-Type'], 'application/x-rendertest')
def test_render_with_status(self):
response = self.client.get('/render/status/')
self.assertEqual(response.status_code, 403)
- self.assertEqual(response.content, b'FOO.BAR../path/to/static/media/\n')
+ self.assertEqual(response.content, b'FOO.BAR../render/status/\n')
@ignore_warnings(category=RemovedInDjango20Warning)
def test_render_with_current_app(self):