@run_with_all_backends
def test_close_case(self):
    extra_number = PhoneNumber.objects.create(domain=self.domain, owner_doc_type='X', owner_id='X', phone_number='999123', verified=True, pending_verification=False, is_two_way=True)
    self.assertEqual(PhoneNumber.count_by_domain(self.domain), 1)
    with create_test_case(self.domain, 'participant', 'test1', drop_signals=False) as case:
        case = self.set_case_property(case, 'contact_phone_number', '99987658765')
        case = self.set_case_property(case, 'contact_phone_number_is_verified', '1')
        self.assertIsNotNone(self.get_case_phone_number(case))
        self.assertEqual(PhoneNumber.count_by_domain(self.domain), 2)
        update_case(self.domain, case.case_id, close=True)
        self.assertIsNone(self.get_case_phone_number(case))
        self.assertEqual(PhoneNumber.count_by_domain(self.domain), 1)
    self.assertEqual(PhoneNumber.get_two_way_number('999123'), extra_number)
@run_with_all_backends
def test_close_case(self):
    extra_number = PhoneNumber.objects.create(domain=self.domain, owner_doc_type='X', owner_id='X', phone_number='999123', verified=True, pending_verification=False, is_two_way=True)
    self.assertEqual(PhoneNumber.count_by_domain(self.domain), 1)
    with create_test_case(self.domain, 'participant', 'test1', drop_signals=False) as case:
        case = self.set_case_property(case, 'contact_phone_number', '99987658765')
        case = self.set_case_property(case, 'contact_phone_number_is_verified', '1')
        self.assertIsNotNone(self.get_case_phone_number(case))
        self.assertEqual(PhoneNumber.count_by_domain(self.domain), 2)
        update_case(self.domain, case.case_id, close=True)
        self.assertIsNone(self.get_case_phone_number(case))
        self.assertEqual(PhoneNumber.count_by_domain(self.domain), 1)
    self.assertEqual(PhoneNumber.get_two_way_number('999123'), extra_number)