From: Alex Morega Date: Sat, 6 Jul 2013 15:47:29 +0000 (+0200) Subject: rewrite regression test X-Git-Tag: 1.0~82 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=751300b3ce6a9e40d60926ef6ed70542caa85f68;p=thirdparty%2Fbabel.git rewrite regression test --- diff --git a/tests/test_dates.py b/tests/test_dates.py index 25202a9f..65f7999d 100644 --- a/tests/test_dates.py +++ b/tests/test_dates.py @@ -314,10 +314,10 @@ class FormatTimedeltaTestCase(unittest.TestCase): class TimeZoneAdjustTestCase(unittest.TestCase): def _utc(self): - UTC = FixedOffsetTimezone(0, 'UTC') - def fake_localize(self, dt, is_dst=False): - raise NotImplementedError() - UTC.localize = types.MethodType(fake_localize, UTC, UTC.__class__) + class EvilFixedOffsetTimezone(FixedOffsetTimezone): + def localize(self, dt, is_dst=False): + raise NotImplementedError() + UTC = EvilFixedOffsetTimezone(0, 'UTC') # This is important to trigger the actual bug (#257) self.assertEqual(False, hasattr(UTC, 'normalize')) return UTC