Example #1
0
    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
Example #2
0
 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
Example #3
0
 def test_validate_phonenum_invalid_6(self):
     errors = defaultdict(list)
     validate_phonenum('phone', {'phone': '123-34(56'}, errors, None)
     assert len(errors) == 1
Example #4
0
 def test_validate_phonenum_invalid_2(self):
     errors = defaultdict(list)
     validate_phonenum('phone', {'phone': '+()1234'}, errors, None)
     assert len(errors) == 1
Example #5
0
 def test_validate_phonenum_valid_6(self):
     errors = defaultdict(list)
     validate_phonenum('phone', {'phone': '61 (0)8 82326262'}, errors, None)
     assert len(errors) == 0
Example #6
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
Example #7
0
 def test_validate_phonenum_valid(self):
     errors = defaultdict(list)
     validate_phonenum(('contact', 0, 'phone'), TEST_DATA_FLATTENED, errors, None)
     assert len(errors) == 0
Example #8
0
 def test_validate_phonenum_invalid_6(self):
     errors = defaultdict(list)
     validate_phonenum('phone', {'phone': '123-34(56'}, errors, None)
     assert len(errors) == 1
Example #9
0
 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
Example #10
0
 def test_validate_phonenum_invalid_2(self):
     errors = defaultdict(list)
     validate_phonenum('phone', {'phone': '+()1234'}, errors, None)
     assert len(errors) == 1
Example #11
0
 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
Example #12
0
 def test_validate_phonenum_valid_6(self):
     errors = defaultdict(list)
     validate_phonenum('phone', {'phone': '61 (0)8 82326262'}, errors, None)
     assert len(errors) == 0
Example #13
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
Example #14
0
 def test_validate_phonenum_valid(self):
     errors = defaultdict(list)
     validate_phonenum(('contact', 0, 'phone'), TEST_DATA_FLATTENED, errors,
                       None)
     assert len(errors) == 0