'Test the {% timezone %} templatetag.'

@requires_tz_support
def test_timezone_templatetag(self):

    tpl = Template(u'{%    load    tz    %}{{    dt    }}|{%    timezone    tz1    %}{{    dt    }}|{%    timezone    tz2    %}{{    dt    }}{%    endtimezone    %}{%    endtimezone    %}')
    ctx = Context({u'dt': datetime.datetime(2011, 9, 1, 10, 20, 30, tzinfo=UTC), u'tz1': ICT, u'tz2': None})
    self.assertEqual(tpl.render(ctx), u'2011-09-01T13:20:30+03:00|2011-09-01T17:20:30+07:00|2011-09-01T13:20:30+03:00')
