'Test the {% timezone %} templatetag with pytz.'

@skipIf((pytz is None), u'this    test    requires    pytz')
def test_timezone_templatetag_with_pytz(self):

    tpl = Template(u'{%    load    tz    %}{%    timezone    tz    %}{{    dt    }}{%    endtimezone    %}')
    ctx = Context({u'dt': datetime.datetime(2011, 9, 1, 13, 20, 30, tzinfo=EAT), u'tz': pytz.timezone(u'Europe/Paris')})
    self.assertEqual(tpl.render(ctx), u'2011-09-01T12:20:30+02:00')
    ctx = Context({u'dt': datetime.datetime(2011, 9, 1, 13, 20, 30, tzinfo=EAT), u'tz': u'Europe/Paris'})
    self.assertEqual(tpl.render(ctx), u'2011-09-01T12:20:30+02:00')
