diff --git a/django/contrib/auth/tests/settings.py b/django/contrib/auth/tests/settings.py
index 7697558..ce2aa7d 100644
a
|
b
|
AUTH_TEMPLATES = [{
|
15 | 15 | 'OPTIONS': { |
16 | 16 | 'context_processors': ( |
17 | 17 | 'django.contrib.auth.context_processors.auth', |
18 | | 'django.template.context_processors.debug', |
19 | | 'django.template.context_processors.i18n', |
20 | | 'django.template.context_processors.media', |
21 | | 'django.template.context_processors.static', |
22 | | 'django.template.context_processors.tz', |
23 | 18 | 'django.contrib.messages.context_processors.messages', |
24 | 19 | ), |
25 | 20 | }, |
diff --git a/tests/admin_views/tests.py b/tests/admin_views/tests.py
index 04dfb09..f991982 100644
a
|
b
|
class AdminViewBasicTest(AdminViewBasicTestCase):
|
800 | 800 | 'OPTIONS': { |
801 | 801 | 'context_processors': [ |
802 | 802 | 'django.template.context_processors.debug', |
803 | | 'django.template.context_processors.i18n', |
804 | | 'django.template.context_processors.tz', |
805 | | 'django.template.context_processors.media', |
806 | | 'django.template.context_processors.static', |
| 803 | 'django.template.context_processors.request', |
807 | 804 | 'django.contrib.auth.context_processors.auth', |
808 | 805 | 'django.contrib.messages.context_processors.messages', |
809 | 806 | ], |
… |
… |
class AdminDocsTest(TestCase):
|
4499 | 4496 | 'OPTIONS': { |
4500 | 4497 | 'context_processors': [ |
4501 | 4498 | 'django.template.context_processors.debug', |
4502 | | 'django.template.context_processors.tz', |
4503 | | 'django.template.context_processors.media', |
4504 | | 'django.template.context_processors.static', |
| 4499 | 'django.template.context_processors.request', |
4505 | 4500 | 'django.contrib.auth.context_processors.auth', |
4506 | 4501 | 'django.contrib.messages.context_processors.messages', |
4507 | 4502 | ], |
diff --git a/tests/runtests.py b/tests/runtests.py
index f742c57..f3ec640 100755
a
|
b
|
def setup(verbosity, test_labels):
|
123 | 123 | 'APP_DIRS': True, |
124 | 124 | 'OPTIONS': { |
125 | 125 | 'context_processors': [ |
126 | | 'django.contrib.auth.context_processors.auth', |
127 | 126 | 'django.template.context_processors.debug', |
128 | | 'django.template.context_processors.i18n', |
129 | | 'django.template.context_processors.media', |
130 | | 'django.template.context_processors.static', |
131 | | 'django.template.context_processors.tz', |
| 127 | 'django.template.context_processors.request', |
| 128 | 'django.contrib.auth.context_processors.auth', |
132 | 129 | 'django.contrib.messages.context_processors.messages', |
133 | 130 | ], |
134 | 131 | }, |
diff --git a/tests/shortcuts/templates/shortcuts/render_test.html b/tests/shortcuts/templates/shortcuts/render_test.html
index 1b2f47a..c2bbd9a 100644
a
|
b
|
|
1 | | {{ foo }}.{{ bar }}.{{ baz }}.{{ STATIC_URL }} |
| 1 | {{ foo }}.{{ bar }}.{{ baz }}.{{ request.path }} |
diff --git a/tests/shortcuts/tests.py b/tests/shortcuts/tests.py
index f5351df..e22cf4d 100644
a
|
b
|
from django.test import TestCase, ignore_warnings, override_settings
|
3 | 3 | |
4 | 4 | |
5 | 5 | @override_settings( |
6 | | STATIC_URL='/path/to/static/media/', |
7 | 6 | ROOT_URLCONF='shortcuts.urls', |
8 | 7 | ) |
9 | 8 | class ShortcutTests(TestCase): |
… |
… |
class ShortcutTests(TestCase):
|
23 | 22 | def test_render_to_response_with_request_context(self): |
24 | 23 | response = self.client.get('/render_to_response/request_context/') |
25 | 24 | self.assertEqual(response.status_code, 200) |
26 | | self.assertEqual(response.content, b'FOO.BAR../path/to/static/media/\n') |
| 25 | self.assertEqual(response.content, b'FOO.BAR../render_to_response/request_context/\n') |
27 | 26 | self.assertEqual(response['Content-Type'], 'text/html; charset=utf-8') |
28 | 27 | |
29 | 28 | def test_render_to_response_with_content_type(self): |
… |
… |
class ShortcutTests(TestCase):
|
52 | 51 | def test_render(self): |
53 | 52 | response = self.client.get('/render/') |
54 | 53 | self.assertEqual(response.status_code, 200) |
55 | | self.assertEqual(response.content, b'FOO.BAR../path/to/static/media/\n') |
| 54 | self.assertEqual(response.content, b'FOO.BAR../render/\n') |
56 | 55 | self.assertEqual(response['Content-Type'], 'text/html; charset=utf-8') |
57 | 56 | self.assertFalse(hasattr(response.context.request, 'current_app')) |
58 | 57 | |
59 | 58 | def test_render_with_multiple_templates(self): |
60 | 59 | response = self.client.get('/render/multiple_templates/') |
61 | 60 | self.assertEqual(response.status_code, 200) |
62 | | self.assertEqual(response.content, b'FOO.BAR../path/to/static/media/\n') |
| 61 | self.assertEqual(response.content, b'FOO.BAR../render/multiple_templates/\n') |
63 | 62 | |
64 | 63 | @ignore_warnings(category=RemovedInDjango20Warning) |
65 | 64 | def test_render_with_base_context(self): |
… |
… |
class ShortcutTests(TestCase):
|
71 | 70 | def test_render_with_content_type(self): |
72 | 71 | response = self.client.get('/render/content_type/') |
73 | 72 | self.assertEqual(response.status_code, 200) |
74 | | self.assertEqual(response.content, b'FOO.BAR../path/to/static/media/\n') |
| 73 | self.assertEqual(response.content, b'FOO.BAR../render/content_type/\n') |
75 | 74 | self.assertEqual(response['Content-Type'], 'application/x-rendertest') |
76 | 75 | |
77 | 76 | def test_render_with_status(self): |
78 | 77 | response = self.client.get('/render/status/') |
79 | 78 | self.assertEqual(response.status_code, 403) |
80 | | self.assertEqual(response.content, b'FOO.BAR../path/to/static/media/\n') |
| 79 | self.assertEqual(response.content, b'FOO.BAR../render/status/\n') |
81 | 80 | |
82 | 81 | @ignore_warnings(category=RemovedInDjango20Warning) |
83 | 82 | def test_render_with_current_app(self): |
diff --git a/tests/timezones/tests.py b/tests/timezones/tests.py
index 586e838..677d51a 100644
a
|
b
|
from django.core import serializers
|
16 | 16 | from django.core.urlresolvers import reverse |
17 | 17 | from django.db.models import Min, Max |
18 | 18 | from django.http import HttpRequest |
19 | | from django.template import Context, RequestContext, Template, TemplateSyntaxError |
20 | | from django.test import TestCase, override_settings, skipIfDBFeature, skipUnlessDBFeature |
| 19 | from django.template import ( |
| 20 | context_processors, Context, RequestContext, Template, TemplateSyntaxError) |
| 21 | from django.test import ( |
| 22 | TestCase, override_settings, skipIfDBFeature, skipUnlessDBFeature) |
21 | 23 | from django.test.utils import requires_tz_support |
22 | 24 | from django.utils import six |
23 | 25 | from django.utils import timezone |
… |
… |
class TemplateTests(TestCase):
|
935 | 937 | Test the django.template.context_processors.tz template context processor. |
936 | 938 | """ |
937 | 939 | tpl = Template("{{ TIME_ZONE }}") |
938 | | self.assertEqual(tpl.render(Context()), "") |
939 | | self.assertEqual(tpl.render(RequestContext(HttpRequest())), "Africa/Nairobi" if pytz else "EAT") |
| 940 | context = Context() |
| 941 | self.assertEqual(tpl.render(context), "") |
| 942 | request_context = RequestContext(HttpRequest(), processors=[context_processors.tz]) |
| 943 | self.assertEqual(tpl.render(request_context), "Africa/Nairobi" if pytz else "EAT") |
940 | 944 | |
941 | 945 | @requires_tz_support |
942 | 946 | def test_date_and_time_template_filters(self): |