def METHOD_NAME(testapp,
                                                 experiment_series_1,
                                                 experiment_rna,
                                                 experiment_dnase,
                                                 library_1,
                                                 library_2,
                                                 biosample_1,
                                                 biosample_2,
                                                 ileum
                                                ):
  testapp.patch_json(biosample_1['@id'], {'biosample_ontology': ileum['uuid']})
  testapp.patch_json(library_1['@id'], {'biosample': biosample_1['@id']})
  testapp.patch_json(library_2['@id'], {'biosample': biosample_2['@id']})
  testapp.patch_json(experiment_series_1['@id'], {'related_datasets':
                                                    [experiment_dnase['@id'],
                                                     experiment_rna['@id']]})
  res = testapp.get(experiment_series_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'] == 'Mismatched biosamples' for
             error in errors_list)