mirror of
https://github.com/django/django.git
synced 2025-08-04 19:08:28 +00:00
Fixed #24124 (again) -- Updated tests with new default context_processors.
Thanks Collin for the review.
This commit is contained in:
parent
511a53b314
commit
5f7230e12f
6 changed files with 18 additions and 28 deletions
|
@ -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):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue