def build_mock_object(obj_id):
 mock_object = Mock()
 object_config = {'pk': obj_id, 'name': 'object {}'.format(obj_id)}
 mock_object.configure_mock(**object_config)
 return mock_object

def build_mock_object ( obj_id ) : mock_object = Mock ( ) object_config = { 'pk' : obj_id , 'name' : 'object {}' . format ( obj_id ) } mock_object . configure_mock ( ** object_config ) return mock_object
build a mock object with the passed id .