diff options
| author | Aymeric Augustin <aymeric.augustin@m4x.org> | 2015-01-12 22:31:44 +0100 |
|---|---|---|
| committer | Aymeric Augustin <aymeric.augustin@m4x.org> | 2015-01-12 22:31:44 +0100 |
| commit | 5f7230e12f0d237cdc19d8930006b0fc7d9dbaa6 (patch) | |
| tree | 3780335d2abb7d5e760c8ef7ac4819ba6e154574 /tests/timezones | |
| parent | 511a53b3142551a1bc3093ed1b6655f57634f510 (diff) | |
Fixed #24124 (again) -- Updated tests with new default context_processors.
Thanks Collin for the review.
Diffstat (limited to 'tests/timezones')
| -rw-r--r-- | tests/timezones/tests.py | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/tests/timezones/tests.py b/tests/timezones/tests.py index 586e838e37..677d51ac2e 100644 --- a/tests/timezones/tests.py +++ b/tests/timezones/tests.py @@ -16,8 +16,10 @@ from django.core import serializers from django.core.urlresolvers import reverse from django.db.models import Min, Max from django.http import HttpRequest -from django.template import Context, RequestContext, Template, TemplateSyntaxError -from django.test import TestCase, override_settings, skipIfDBFeature, skipUnlessDBFeature +from django.template import ( + context_processors, Context, RequestContext, Template, TemplateSyntaxError) +from django.test import ( + TestCase, override_settings, skipIfDBFeature, skipUnlessDBFeature) from django.test.utils import requires_tz_support from django.utils import six from django.utils import timezone @@ -935,8 +937,10 @@ class TemplateTests(TestCase): Test the django.template.context_processors.tz template context processor. """ tpl = Template("{{ TIME_ZONE }}") - self.assertEqual(tpl.render(Context()), "") - self.assertEqual(tpl.render(RequestContext(HttpRequest())), "Africa/Nairobi" if pytz else "EAT") + context = Context() + self.assertEqual(tpl.render(context), "") + request_context = RequestContext(HttpRequest(), processors=[context_processors.tz]) + self.assertEqual(tpl.render(request_context), "Africa/Nairobi" if pytz else "EAT") @requires_tz_support def test_date_and_time_template_filters(self): |
