def delete_test_ontology_terms_data(): on_terms = SESSION.query(OntologyTerm).all() # each OntologyTerm needs to be deleted individually in order to delete # the associated records from table 'on_pairs'; # bulk deleting all OntologyTerm instances doesn't delete the records in 'on_pairs' for term in on_terms: SESSION.delete(term)
def delete_genes_test_data(): genes = SESSION.query(Gene).all() # each Gene needs to be deleted individually in order to delete # the associated records from table 'gene_ontology_map'; # bulk deleting all Gene instances doesn't delete the records in 'gene_ontology_map' for gene in genes: SESSION.delete(gene)