          self.assertEqual(dateformat.format(my_birthday, 'a'), 'p.m.')
  
      def test_date_formats(self):
          my_birthday = datetime(1979, 7, 8, 22, 00)
          timestamp = datetime(2008, 5, 19, 11, 45, 23, 123456)
  
          self.assertEqual(dateformat.format(my_birthday, 'A'), 'PM')
          self.assertEqual(dateformat.format(timestamp, 'c'), '2008-05-19T11:45:23.123456')
 
</s> remove         "Microseconds"
        return self.data.microsecond
 </s> add         "Microseconds; i.e. '000000' to '999999'"
        return '%06d' %self.data.microsecond </s> remove u                 Microseconds.                             ``0`` to ``999999``
 </s> add u                 Microseconds.                             ``000000`` to ``999999``
    def test_microsecond(self):
        # Regression test for #18951
        dt = datetime(2009, 5, 16, microsecond=123)
        self.assertEqual(dateformat.format(dt, 'u'), '000123')

          self.assertEqual(dateformat.format(my_birthday, 'a'), 'p.m.')
  
    def test_microsecond(self):
        # Regression test for #18951
        dt = datetime(2009, 5, 16, microsecond=123)
        self.assertEqual(dateformat.format(dt, 'u'), '000123')

      def test_date_formats(self):
          my_birthday = datetime(1979, 7, 8, 22, 00)
          timestamp = datetime(2008, 5, 19, 11, 45, 23, 123456)
  
          self.assertEqual(dateformat.format(my_birthday, 'A'), 'PM')
          self.assertEqual(dateformat.format(timestamp, 'c'), '2008-05-19T11:45:23.123456')
keep add keep keep keep keep keep keep
 Fixed #18951 -- Formatting of microseconds.

Thanks olofom at gmail com for the report. 
tests/regressiontests/utils/dateformat.py