@run_with_all_backends
def test_delete_phone_numbers_for_owners(self):
    with self.create_case_contact('9990001') as case1, self.create_case_contact('9990002') as case2, self.create_case_contact('9990003') as case3:
        self.assertEqual(len(PhoneNumber.by_owner_id(case1.case_id)), 1)
        self.assertEqual(len(PhoneNumber.by_owner_id(case2.case_id)), 1)
        self.assertEqual(len(PhoneNumber.by_owner_id(case3.case_id)), 1)
        self.assertEqual(PhoneNumber.count_by_domain(self.domain), 3)
        delete_phone_numbers_for_owners([case2.case_id, case3.case_id])
        self.assertEqual(len(PhoneNumber.by_owner_id(case1.case_id)), 1)
        self.assertEqual(len(PhoneNumber.by_owner_id(case2.case_id)), 0)
        self.assertEqual(len(PhoneNumber.by_owner_id(case3.case_id)), 0)
        self.assertEqual(PhoneNumber.count_by_domain(self.domain), 1)
@run_with_all_backends
def test_delete_phone_numbers_for_owners(self):
    with self.create_case_contact('9990001') as case1, self.create_case_contact('9990002') as case2, self.create_case_contact('9990003') as case3:
        self.assertEqual(len(PhoneNumber.by_owner_id(case1.case_id)), 1)
        self.assertEqual(len(PhoneNumber.by_owner_id(case2.case_id)), 1)
        self.assertEqual(len(PhoneNumber.by_owner_id(case3.case_id)), 1)
        self.assertEqual(PhoneNumber.count_by_domain(self.domain), 3)
        delete_phone_numbers_for_owners([case2.case_id, case3.case_id])
        self.assertEqual(len(PhoneNumber.by_owner_id(case1.case_id)), 1)
        self.assertEqual(len(PhoneNumber.by_owner_id(case2.case_id)), 0)
        self.assertEqual(len(PhoneNumber.by_owner_id(case3.case_id)), 0)
        self.assertEqual(PhoneNumber.count_by_domain(self.domain), 1)