def test_to_dict(self): class Bar(object): def to_dict(self): return { 'prop': 'val' } class Foo(object): x = 1 y = 2 z = 7 bar = Bar() bar_list = [Bar(), Bar()] self.assertEqual( { 'x': 1, 'y': 2, 'bar': {'prop': 'val'}, 'bar_list': [{'prop': 'val'}, {'prop': 'val'}] }, util.to_dict(Foo(), ['x', 'y', 'bar', 'bar_list']) )
def to_dict(self): return util.to_dict(self, FailedScheduleItem.TO_DICT_FIELDS)
def to_dict(self): return util.to_dict(self, SectionMeeting.TO_DICT_FIELDS)
def to_dict(self): return util.to_dict(self, self.TO_DICT_FIELDS)