def METHOD_NAME(testapp, reference_epigenome_1,
                                                           reference_experiment_RNA_seq,
                                                           reference_experiment_RRBS,
                                                           replicate_RNA_seq,
                                                           replicate_RRBS,
                                                           library_1,
                                                           library_2,
                                                           biosample_1,
                                                           biosample_2,
                                                           donor_1,
                                                           donor_2,
                                                           liver,
                                                           heart):
    testapp.patch_json(biosample_1['@id'], {'donor': donor_1['@id'],
                                            'biosample_ontology': liver['uuid']})
    testapp.patch_json(biosample_2['@id'], {'donor': donor_2['@id'],
                                            'biosample_ontology': heart['uuid']})
    testapp.patch_json(library_1['@id'], {'biosample': biosample_1['@id']})
    testapp.patch_json(library_2['@id'], {'biosample': biosample_2['@id']})
    testapp.patch_json(reference_epigenome_1['@id'], {'related_datasets':
                                                      [reference_experiment_RNA_seq['@id'],
                                                       reference_experiment_RRBS['@id']]})
    res = testapp.get(reference_epigenome_1['@id'] + '@@index-data')
    errors = res.json['audit']
    errors_list = []
    for error_type in errors:
        errors_list.extend(errors[error_type])
    assert any(error['category'] == 'multiple biosample term names in reference epigenome' for
               error in errors_list)