def METHOD_NAME(app, patron_sion_data,
                               patron_type_grown_sion):
    """Test extract_data_from_ref."""
    # Check real data
    ptty = patron_sion_data['patron']['type']
    assert extracted_data_from_ref(ptty, data='pid') == 'ptty4'
    assert extracted_data_from_ref(ptty, data='resource') == 'patron_types'
    assert extracted_data_from_ref(ptty, data='record_class') == PatronType
    ptty_record = extracted_data_from_ref(ptty, data='record')
    assert ptty_record.pid == patron_type_grown_sion.pid
    assert extracted_data_from_ref(ptty, data='es_record')['pid'] == 'ptty4'
    # check dummy data
    assert extracted_data_from_ref('dummy_data', data='pid') is None
    assert extracted_data_from_ref('dummy_data', data='resource') is None
    assert extracted_data_from_ref('dummy_data', data='record_class') is None
    assert extracted_data_from_ref('dummy_data', data='record') is None
    assert extracted_data_from_ref(ptty, data='dummy') is None
    assert extracted_data_from_ref('dummy_data', data='es_record') is None