

@requires_pytz
def test_get_current_timezone_templatetag_with_pytz(self):
    '\n        Test the {% get_current_timezone %} templatetag with pytz.\n        '
    tpl = Template('{% load tz %}{% get_current_timezone as time_zone %}{{ time_zone }}')
    with timezone.override(pytz.timezone('Europe/Paris')):
        self.assertEqual(tpl.render(Context()), 'Europe/Paris')
    tpl = Template("{% load tz %}{% timezone 'Europe/Paris' %}{% get_current_timezone as time_zone %}{% endtimezone %}{{ time_zone }}")
    self.assertEqual(tpl.render(Context()), 'Europe/Paris')

dataset/ETHPy150Open django/django/tests/timezones/tests.py TemplateTests.test_get_current_timezone_templatetag_with_pytz/original