Comment 4 for bug 290254

Revision history for this message
Tres Seaver (tseaver) wrote :

I can't reproduce with this test. Note that I verified that dt.__dict__
matches the one in the 2.9 'datum' above.

    def test_strftime_old_instance(self):
        # https://bugs.launchpad.net/zope2/+bug/290254
        # Ensure that dates without _micros attribute (e.g., from old
        # pickles) still render correctly in strftime.
        ISO = '2001-10-10T00:00:00+02:00'
        dt = DateTime(ISO)
        dt._millis = dt._micros / 1000
        del dt._micros
        self.assertEqual(dt.strftime('%Y'), '2001')