

@requires_pytz
def test_timezone_templatetag_with_pytz(self):
    '\n        Test the {% timezone %} templatetag with pytz.\n        '
    tpl = Template('{% load tz %}{% timezone tz %}{{ dt }}{% endtimezone %}')
    ctx = Context({
        'dt': datetime.datetime(2011, 9, 1, 13, 20, 30, tzinfo=EAT),
        'tz': pytz.timezone('Europe/Paris'),
    })
    self.assertEqual(tpl.render(ctx), '2011-09-01T12:20:30+02:00')
    ctx = Context({
        'dt': datetime.datetime(2011, 9, 1, 13, 20, 30, tzinfo=EAT),
        'tz': 'Europe/Paris',
    })
    self.assertEqual(tpl.render(tpl), '2011-09-01T12:20:30+02:00')

dataset/ETHPy150Open django/django/tests/timezones/tests.py TemplateTests.test_timezone_templatetag_with_pytz/VarMisuse@125/215 `ctx`->`tpl`