def test_catch_extra_attribute(self): # The mapper for PersistentMappings doesn't allow an # extra attribute. classification = None ob = PersistentMapping() ob.extra = '678' ob['a'] = 'b' ob['c'] = 'd' obj_db = MockObjectDatabase() m = self.conf.mappers["pm"] event = SerializationEvent( self.conf, m, '', classification, obj_db, ob) self.assertRaises(SerializationError, m.serializer.serialize, event)