def test_delete_case_search_cases(self): """ Tests that cases are correctly removed from the es index """ other_domain = "braavos" self._bootstrap_cases_in_es_for_domain(self.domain) case = self._bootstrap_cases_in_es_for_domain(other_domain) with self.assertRaises(TypeError): delete_case_search_cases(None) with self.assertRaises(TypeError): delete_case_search_cases({}) # delete cases from one domain delete_case_search_cases(self.domain) # make sure the other domain's cases are still there self._assert_case_in_es(other_domain, case) # delete other domains cases delete_case_search_cases(other_domain) # make sure nothing is left self._assert_index_empty()
def delete_case_search_cases_for_domain(domain): delete_case_search_cases(domain)