def test_localize_datetime(self): dt = datetime.datetime(2010, 5, 3, 14, 54, 21, tzinfo=pytz.utc) naive_dt = datetime.datetime(2010, 5, 3, 15, 54, 21) local_dt = self.app.config['TIME_ZONE'].localize(naive_dt) self.assertEqual(filters.localize_datetime(dt), local_dt)
def test_localize_datetime_with_naive_datetime(self): dt = datetime.datetime(2010, 5, 3, 14, 54, 21) self.assertEqual(filters.localize_datetime(dt), dt)