def test_normalise_phone_number_raises_if_unparseable_characters(phone_number): assert normalise_phone_number(phone_number) is False
def test_normalise_phone_number_raises_if_unparseable_characters(phone_number): with pytest.raises(InvalidPhoneError): normalise_phone_number(phone_number)
def valid_phone_number(self, num): try: normalise_phone_number(num.data) return True except InvalidPhoneError: raise ValidationError('Must be a valid phone number')