def test_validate_phonenum_invalid(self): errors = defaultdict(list) dada = copy.deepcopy(TEST_DATA_FLATTENED) dada[('contact', 0, 'phone')] = u'123_notgood_456' validate_phonenum(('contact', 0, 'phone'), dada, errors, None) assert len(errors) == 1
def test_validate_phonenum_invalid_7(self): errors = defaultdict(list) validate_phonenum('phone', {'phone': '+23 (3) 45 (4)-22'}, errors, None) assert len(errors) == 1
def test_validate_phonenum_invalid_6(self): errors = defaultdict(list) validate_phonenum('phone', {'phone': '123-34(56'}, errors, None) assert len(errors) == 1
def test_validate_phonenum_invalid_2(self): errors = defaultdict(list) validate_phonenum('phone', {'phone': '+()1234'}, errors, None) assert len(errors) == 1
def test_validate_phonenum_valid_6(self): errors = defaultdict(list) validate_phonenum('phone', {'phone': '61 (0)8 82326262'}, errors, None) assert len(errors) == 0
def test_validate_phonenum_valid_5(self): errors = defaultdict(list) validate_phonenum('phone', {'phone': '+1 555 123-4567'}, errors, None) assert len(errors) == 0
def test_validate_phonenum_valid(self): errors = defaultdict(list) validate_phonenum(('contact', 0, 'phone'), TEST_DATA_FLATTENED, errors, None) assert len(errors) == 0