Exemplo n.º 1
0
 def test_michigan(self):
     dl_state = 'MI'
     self.assertFalse(is_valid('1234567', dl_state))
     self.assertTrue(is_valid('a123456789012', dl_state))
     self.assertTrue(is_valid('L123456789012', dl_state))
     self.assertFalse(is_valid('a1234567890', dl_state))
     self.assertFalse(is_valid('ab1234567', dl_state))
Exemplo n.º 2
0
 def test_massachusetts(self):
     dl_state = 'MA'
     self.assertTrue(is_valid('123456789', dl_state))
     self.assertTrue(is_valid('s12345678', dl_state))
     self.assertTrue(is_valid('S12345678', dl_state))
     self.assertFalse(is_valid('a1234567890', dl_state))
     self.assertFalse(is_valid('ab1234567', dl_state))
Exemplo n.º 3
0
 def test_minnesota(self):
     dl_state = 'MN'
     self.assertFalse(is_valid('1234567', dl_state))
     self.assertTrue(is_valid('a123456789012', dl_state))
     self.assertTrue(is_valid('M123456789012', dl_state))
     self.assertFalse(is_valid('a1234567890', dl_state))
     self.assertFalse(is_valid('ab1234567', dl_state))
Exemplo n.º 4
0
 def test_maryland(self):
     dl_state = 'MD'
     self.assertFalse(is_valid('1234567', dl_state))
     self.assertTrue(is_valid('a123456789012', dl_state))
     self.assertTrue(is_valid('M123456789012', dl_state))
     self.assertFalse(is_valid('a1234567890', dl_state))
     self.assertFalse(is_valid('ab1234567', dl_state))
Exemplo n.º 5
0
 def test_idaho(self):
     dl_state = 'ID'
     self.assertTrue(is_valid('123456789', dl_state))
     self.assertTrue(is_valid('ab123456a', dl_state))
     self.assertTrue(is_valid('AB123456A', dl_state))
     self.assertFalse(is_valid('a12345678', dl_state))
     self.assertFalse(is_valid('ab1234', dl_state))
Exemplo n.º 6
0
 def test_idaho(self):
     dl_state = 'ID'
     self.assertTrue(is_valid('123456789', dl_state))
     self.assertTrue(is_valid('ab123456a', dl_state))
     self.assertTrue(is_valid('AB123456A', dl_state))
     self.assertFalse(is_valid('a12345678', dl_state))
     self.assertFalse(is_valid('ab1234', dl_state))
Exemplo n.º 7
0
 def test_new_hampshire(self):
     dl_state = 'NH'
     self.assertFalse(is_valid('123456789', dl_state))
     self.assertFalse(is_valid('a12345', dl_state))
     self.assertFalse(is_valid('ab1234567', dl_state))
     self.assertTrue(is_valid('12abc12345', dl_state))
     self.assertTrue(is_valid('12ABC12345', dl_state))
Exemplo n.º 8
0
 def test_colorado(self):
     dl_state = 'CO'
     self.assertTrue(is_valid('123456789', dl_state))
     self.assertFalse(is_valid('12345678', dl_state))
     self.assertTrue(is_valid('a123456', dl_state))
     self.assertTrue(is_valid('A123', dl_state))
     self.assertFalse(is_valid('Ab12345', dl_state))
Exemplo n.º 9
0
 def test_new_jersey(self):
     dl_state = 'NJ'
     self.assertFalse(is_valid('123456789', dl_state))
     self.assertTrue(is_valid('a12345678901234', dl_state))
     self.assertTrue(is_valid('N12345678901234', dl_state))
     self.assertFalse(is_valid('a1234567890', dl_state))
     self.assertFalse(is_valid('ab1234567', dl_state))
Exemplo n.º 10
0
 def test_nebraska(self):
     dl_state = 'NE'
     self.assertTrue(is_valid('a123456', dl_state))
     self.assertTrue(is_valid('a123', dl_state))
     self.assertTrue(is_valid('a12345678', dl_state))
     self.assertFalse(is_valid('12345678', dl_state))
     self.assertFalse(is_valid('12345678a', dl_state))
Exemplo n.º 11
0
 def test_colorado(self):
     dl_state = 'CO'
     self.assertTrue(is_valid('123456789', dl_state))
     self.assertFalse(is_valid('12345678', dl_state))
     self.assertTrue(is_valid('a123456', dl_state))
     self.assertTrue(is_valid('A123', dl_state))
     self.assertFalse(is_valid('Ab12345', dl_state))
Exemplo n.º 12
0
 def test_tennessee(self):
     dl_state = 'TN'
     self.assertTrue(is_valid('1234567', dl_state))
     self.assertTrue(is_valid('123456789', dl_state))
     self.assertFalse(is_valid('ab123', dl_state))
     self.assertFalse(is_valid('a123456', dl_state))
     self.assertFalse(is_valid('1234567890123', dl_state))
Exemplo n.º 13
0
 def test_tennessee(self):
     dl_state = 'TN'
     self.assertTrue(is_valid('1234567', dl_state))
     self.assertTrue(is_valid('123456789', dl_state))
     self.assertFalse(is_valid('ab123', dl_state))
     self.assertFalse(is_valid('a123456', dl_state))
     self.assertFalse(is_valid('1234567890123', dl_state))
Exemplo n.º 14
0
 def test_texas(self):
     dl_state = 'TX'
     self.assertTrue(is_valid('12345678', dl_state))
     self.assertFalse(is_valid('1234567', dl_state))
     self.assertFalse(is_valid('ab123', dl_state))
     self.assertFalse(is_valid('a123456', dl_state))
     self.assertFalse(is_valid('1234567890123', dl_state))
Exemplo n.º 15
0
 def test_south_carolina(self):
     dl_state = 'SC'
     self.assertTrue(is_valid('12345678', dl_state))
     self.assertTrue(is_valid('1234567890', dl_state))
     self.assertFalse(is_valid('ab123', dl_state))
     self.assertFalse(is_valid('a123456', dl_state))
     self.assertFalse(is_valid('1234567890123', dl_state))
Exemplo n.º 16
0
 def test_rhode_island(self):
     dl_state = 'RI'
     self.assertTrue(is_valid('1234567', dl_state))
     self.assertFalse(is_valid('ab123', dl_state))
     self.assertTrue(is_valid('v123456', dl_state))
     self.assertTrue(is_valid('V123456', dl_state))
     self.assertFalse(is_valid('1234567890123', dl_state))
Exemplo n.º 17
0
 def test_oregon(self):
     dl_state = 'OR'
     self.assertTrue(is_valid('12345678', dl_state))
     self.assertTrue(is_valid('a123456', dl_state))
     self.assertTrue(is_valid('OR12345', dl_state))
     self.assertFalse(is_valid('a12345678', dl_state))
     self.assertFalse(is_valid('1234567890123', dl_state))
Exemplo n.º 18
0
 def test_utah(self):
     dl_state = 'UT'
     self.assertTrue(is_valid('1234', dl_state))
     self.assertTrue(is_valid('123456789', dl_state))
     self.assertFalse(is_valid('ab123', dl_state))
     self.assertFalse(is_valid('a123456', dl_state))
     self.assertFalse(is_valid('1234567890123', dl_state))
Exemplo n.º 19
0
 def test_iowa(self):
     dl_state = 'IA'
     self.assertTrue(is_valid('123456789', dl_state))
     self.assertFalse(is_valid('a12345678', dl_state))
     self.assertFalse(is_valid('ab1234567', dl_state))
     self.assertTrue(is_valid('123ab1234', 'IA'))
     self.assertTrue(is_valid('123AB1234', 'IA'))
Exemplo n.º 20
0
 def test_massachusetts(self):
     dl_state = 'MA'
     self.assertTrue(is_valid('123456789', dl_state))
     self.assertTrue(is_valid('s12345678', dl_state))
     self.assertTrue(is_valid('S12345678', dl_state))
     self.assertFalse(is_valid('a1234567890', dl_state))
     self.assertFalse(is_valid('ab1234567', dl_state))
Exemplo n.º 21
0
 def test_wisconsin(self):
     dl_state = 'WI'
     self.assertTrue(is_valid('a1234567890123', dl_state))
     self.assertTrue(is_valid('W1234567890123', dl_state))
     self.assertFalse(is_valid('ab123', dl_state))
     self.assertFalse(is_valid('a123456', dl_state))
     self.assertFalse(is_valid('1234567890123', dl_state))
Exemplo n.º 22
0
 def test_west_virginia(self):
     dl_state = 'WV'
     self.assertTrue(is_valid('1234567', dl_state))
     self.assertFalse(is_valid('a12345', dl_state))
     self.assertFalse(is_valid('WV123456', dl_state))
     self.assertFalse(is_valid('a1234567', dl_state))
     self.assertFalse(is_valid('1234567890123', dl_state))
Exemplo n.º 23
0
 def test_iowa(self):
     dl_state = 'IA'
     self.assertTrue(is_valid('123456789', dl_state))
     self.assertFalse(is_valid('a12345678', dl_state))
     self.assertFalse(is_valid('ab1234567', dl_state))
     self.assertTrue(is_valid('123ab1234', 'IA'))
     self.assertTrue(is_valid('123AB1234', 'IA'))
Exemplo n.º 24
0
 def test_utah(self):
     dl_state = 'UT'
     self.assertTrue(is_valid('1234', dl_state))
     self.assertTrue(is_valid('123456789', dl_state))
     self.assertFalse(is_valid('ab123', dl_state))
     self.assertFalse(is_valid('a123456', dl_state))
     self.assertFalse(is_valid('1234567890123', dl_state))
Exemplo n.º 25
0
 def test_oklahoma(self):
     dl_state = 'OK'
     self.assertTrue(is_valid('123456789', dl_state))
     self.assertFalse(is_valid('ab123', dl_state))
     self.assertTrue(is_valid('a123456789', dl_state))
     self.assertTrue(is_valid('O123456789', dl_state))
     self.assertFalse(is_valid('1234567890123', dl_state))
Exemplo n.º 26
0
 def test_south_carolina(self):
     dl_state = 'SC'
     self.assertTrue(is_valid('12345678', dl_state))
     self.assertTrue(is_valid('1234567890', dl_state))
     self.assertFalse(is_valid('ab123', dl_state))
     self.assertFalse(is_valid('a123456', dl_state))
     self.assertFalse(is_valid('1234567890123', dl_state))
Exemplo n.º 27
0
 def test_oklahoma(self):
     dl_state = 'OK'
     self.assertTrue(is_valid('123456789', dl_state))
     self.assertFalse(is_valid('ab123', dl_state))
     self.assertTrue(is_valid('a123456789', dl_state))
     self.assertTrue(is_valid('O123456789', dl_state))
     self.assertFalse(is_valid('1234567890123', dl_state))
Exemplo n.º 28
0
 def test_wisconsin(self):
     dl_state = 'WI'
     self.assertTrue(is_valid('a1234567890123', dl_state))
     self.assertTrue(is_valid('W1234567890123', dl_state))
     self.assertFalse(is_valid('ab123', dl_state))
     self.assertFalse(is_valid('a123456', dl_state))
     self.assertFalse(is_valid('1234567890123', dl_state))
Exemplo n.º 29
0
 def test_texas(self):
     dl_state = 'TX'
     self.assertTrue(is_valid('12345678', dl_state))
     self.assertFalse(is_valid('1234567', dl_state))
     self.assertFalse(is_valid('ab123', dl_state))
     self.assertFalse(is_valid('a123456', dl_state))
     self.assertFalse(is_valid('1234567890123', dl_state))
Exemplo n.º 30
0
 def test_arizona(self):
     dl_state = 'AZ'
     self.assertFalse(is_valid('1234567', dl_state))
     self.assertTrue(is_valid('a12345678', dl_state))
     self.assertTrue(is_valid('A12345678', dl_state))
     self.assertFalse(is_valid('aB12345', dl_state))
     self.assertTrue(is_valid('123456789', dl_state))
Exemplo n.º 31
0
 def test_maryland(self):
     dl_state = 'MD'
     self.assertFalse(is_valid('1234567', dl_state))
     self.assertTrue(is_valid('a123456789012', dl_state))
     self.assertTrue(is_valid('M123456789012', dl_state))
     self.assertFalse(is_valid('a1234567890', dl_state))
     self.assertFalse(is_valid('ab1234567', dl_state))
Exemplo n.º 32
0
 def test_montana(self):
     dl_state = 'MT'
     self.assertTrue(is_valid('abcdefghi', dl_state))
     self.assertTrue(is_valid('1234567890123', dl_state))
     self.assertFalse(is_valid('a12345678', dl_state))
     self.assertFalse(is_valid('a1234567890', dl_state))
     self.assertFalse(is_valid('ab1234567', dl_state))
Exemplo n.º 33
0
 def test_michigan(self):
     dl_state = 'MI'
     self.assertFalse(is_valid('1234567', dl_state))
     self.assertTrue(is_valid('a123456789012', dl_state))
     self.assertTrue(is_valid('L123456789012', dl_state))
     self.assertFalse(is_valid('a1234567890', dl_state))
     self.assertFalse(is_valid('ab1234567', dl_state))
Exemplo n.º 34
0
 def test_new_hampshire(self):
     dl_state = 'NH'
     self.assertFalse(is_valid('123456789', dl_state))
     self.assertFalse(is_valid('a12345', dl_state))
     self.assertFalse(is_valid('ab1234567', dl_state))
     self.assertTrue(is_valid('12abc12345', dl_state))
     self.assertTrue(is_valid('12ABC12345', dl_state))
Exemplo n.º 35
0
 def test_new_jersey(self):
     dl_state = 'NJ'
     self.assertFalse(is_valid('123456789', dl_state))
     self.assertTrue(is_valid('a12345678901234', dl_state))
     self.assertTrue(is_valid('N12345678901234', dl_state))
     self.assertFalse(is_valid('a1234567890', dl_state))
     self.assertFalse(is_valid('ab1234567', dl_state))
Exemplo n.º 36
0
 def test_nebraska(self):
     dl_state = 'NE'
     self.assertTrue(is_valid('a123456', dl_state))
     self.assertTrue(is_valid('a123', dl_state))
     self.assertTrue(is_valid('a12345678', dl_state))
     self.assertFalse(is_valid('12345678', dl_state))
     self.assertFalse(is_valid('12345678a', dl_state))
Exemplo n.º 37
0
 def test_oregon(self):
     dl_state = 'OR'
     self.assertTrue(is_valid('12345678', dl_state))
     self.assertTrue(is_valid('a123456', dl_state))
     self.assertTrue(is_valid('OR12345', dl_state))
     self.assertFalse(is_valid('a12345678', dl_state))
     self.assertFalse(is_valid('1234567890123', dl_state))
Exemplo n.º 38
0
 def test_montana(self):
     dl_state = 'MT'
     self.assertTrue(is_valid('abcdefghi', dl_state))
     self.assertTrue(is_valid('1234567890123', dl_state))
     self.assertFalse(is_valid('a12345678', dl_state))
     self.assertFalse(is_valid('a1234567890', dl_state))
     self.assertFalse(is_valid('ab1234567', dl_state))
Exemplo n.º 39
0
 def test_rhode_island(self):
     dl_state = 'RI'
     self.assertTrue(is_valid('1234567', dl_state))
     self.assertFalse(is_valid('ab123', dl_state))
     self.assertTrue(is_valid('v123456', dl_state))
     self.assertTrue(is_valid('V123456', dl_state))
     self.assertFalse(is_valid('1234567890123', dl_state))
Exemplo n.º 40
0
 def test_minnesota(self):
     dl_state = 'MN'
     self.assertFalse(is_valid('1234567', dl_state))
     self.assertTrue(is_valid('a123456789012', dl_state))
     self.assertTrue(is_valid('M123456789012', dl_state))
     self.assertFalse(is_valid('a1234567890', dl_state))
     self.assertFalse(is_valid('ab1234567', dl_state))
Exemplo n.º 41
0
 def test_arizona(self):
     dl_state = 'AZ'
     self.assertFalse(is_valid('1234567', dl_state))
     self.assertTrue(is_valid('a12345678', dl_state))
     self.assertTrue(is_valid('A12345678', dl_state))
     self.assertFalse(is_valid('aB12345', dl_state))
     self.assertTrue(is_valid('123456789', dl_state))
Exemplo n.º 42
0
 def test_territories(self):
     for dl_state in OTHER_STATES:
         self.assertTrue(is_valid('1234567890', dl_state, True))
         self.assertTrue(is_valid('ab123', dl_state, True))
         self.assertTrue(is_valid('**--  ', dl_state, True))
         self.assertTrue(is_valid('.', dl_state, True))
         self.assertTrue(is_valid('icantbelieveijustwroteallthesetests',
                                  dl_state, True))
Exemplo n.º 43
0
 def test_allow_territories(self):
     dl_num = "doesnt_matter"
     self.assertRaises(Exception, is_valid, dl_num, "AS", False)
     self.assertRaises(Exception, is_valid, dl_num, "FM", False)
     self.assertRaises(Exception, is_valid, dl_num, "AA", False)
     self.assertTrue(is_valid(dl_num, "AS", True))
     self.assertTrue(is_valid(dl_num, "FM", True))
     self.assertTrue(is_valid(dl_num, "AA", True))
Exemplo n.º 44
0
 def test_allow_territories(self):
     dl_num = "doesnt_matter"
     self.assertRaises(Exception, is_valid, dl_num, "AS", False)
     self.assertRaises(Exception, is_valid, dl_num, "FM", False)
     self.assertRaises(Exception, is_valid, dl_num, "AA", False)
     self.assertTrue(is_valid(dl_num, "AS", True))
     self.assertTrue(is_valid(dl_num, "FM", True))
     self.assertTrue(is_valid(dl_num, "AA", True))
Exemplo n.º 45
0
 def test_territories(self):
     for dl_state in OTHER_STATES:
         self.assertTrue(is_valid('1234567890', dl_state, True))
         self.assertTrue(is_valid('ab123', dl_state, True))
         self.assertTrue(is_valid('**--  ', dl_state, True))
         self.assertTrue(is_valid('.', dl_state, True))
         self.assertTrue(
             is_valid('icantbelieveijustwroteallthesetests', dl_state,
                      True))
Exemplo n.º 46
0
 def test_west_virginia(self):
     dl_state = 'WV'
     self.assertTrue(is_valid('1234567', dl_state))
     self.assertTrue(is_valid('F478888', dl_state))
     self.assertTrue(is_valid('A12345', dl_state))
     self.assertTrue(is_valid('c123456', dl_state))
     self.assertTrue(is_valid('zb12345', dl_state))
     self.assertTrue(is_valid('aZ123456', dl_state))
     self.assertFalse(is_valid('WV1234567', dl_state))
     self.assertFalse(is_valid('a1234567', dl_state))
     self.assertFalse(is_valid('12345', dl_state))
     self.assertFalse(is_valid('1234567890123', dl_state))
Exemplo n.º 47
0
    def clean_license_id_number(self):
        
        state = self.cleaned_data.get('registered_state')
        license = self.cleaned_data.get('license_id_number')
        if not is_valid(license, state):

            raise forms.ValidationError("License # is not valid for registered state.")

        return license
Exemplo n.º 48
0
    def test_missouri(self):
        dl_state = 'MO'
        self.assertTrue(is_valid('123456789', dl_state))
        self.assertTrue(is_valid('a12345678', dl_state))
        self.assertTrue(is_valid('a12345', dl_state))
        self.assertTrue(is_valid('A12345678', dl_state))
        self.assertTrue(is_valid('A123456', dl_state))

        self.assertFalse(is_valid('12345678ab', dl_state))
        self.assertFalse(is_valid('123456789a', dl_state))
        self.assertFalse(is_valid('ab1234567', dl_state))
Exemplo n.º 49
0
    def test_missouri(self):
        dl_state = 'MO'
        self.assertTrue(is_valid('123456789', dl_state))
        self.assertTrue(is_valid('a12345678', dl_state))
        self.assertTrue(is_valid('a12345', dl_state))
        self.assertTrue(is_valid('A12345678', dl_state))
        self.assertTrue(is_valid('A123456', dl_state))

        self.assertFalse(is_valid('12345678ab', dl_state))
        self.assertFalse(is_valid('123456789a', dl_state))
        self.assertFalse(is_valid('ab1234567', dl_state))
Exemplo n.º 50
0
 def test_nevada(self):
     dl_state = 'NV'
     self.assertFalse(is_valid('1234', dl_state))
     self.assertTrue(is_valid('1234567890', dl_state))
     self.assertTrue(is_valid('x12345678', dl_state))
     self.assertTrue(is_valid('X12345678', dl_state))
     self.assertFalse(is_valid('a123456', dl_state))
     self.assertFalse(is_valid('a12345678', dl_state))
     self.assertFalse(is_valid('12345678', dl_state))
Exemplo n.º 51
0
 def test_nevada(self):
     dl_state = 'NV'
     self.assertFalse(is_valid('1234', dl_state))
     self.assertTrue(is_valid('1234567890', dl_state))
     self.assertTrue(is_valid('x12345678', dl_state))
     self.assertTrue(is_valid('X12345678', dl_state))
     self.assertFalse(is_valid('a123456', dl_state))
     self.assertFalse(is_valid('a12345678', dl_state))
     self.assertFalse(is_valid('12345678', dl_state))
Exemplo n.º 52
0
 def test_new_york(self):
     dl_state = 'NY'
     self.assertTrue(is_valid('123456789', dl_state))
     self.assertTrue(is_valid('A123456789012345678', dl_state))
     self.assertFalse(is_valid('12345678', dl_state))
     self.assertFalse(is_valid('1234567890123456', dl_state))
     self.assertFalse(is_valid('a1234567', dl_state))
     self.assertFalse(is_valid('NEWaYORK', dl_state))
     self.assertFalse(is_valid('123456', dl_state))
Exemplo n.º 53
0
 def test_washington(self):
     dl_state = 'WA'
     self.assertTrue(is_valid('abcdefg12345', dl_state))
     self.assertTrue(is_valid('ab*****123ab', dl_state))
     self.assertTrue(is_valid('WASH*AB12345', dl_state))
     self.assertTrue(is_valid('ab*INGT1234b', dl_state))
     self.assertFalse(is_valid('ab123', dl_state))
     self.assertFalse(is_valid('a123456', dl_state))
     self.assertFalse(is_valid('abcd123456789', dl_state))
Exemplo n.º 54
0
 def test_washington(self):
     dl_state = 'WA'
     self.assertTrue(is_valid('abcdefg12345', dl_state))
     self.assertTrue(is_valid('ab*****123ab', dl_state))
     self.assertTrue(is_valid('WASH*AB12345', dl_state))
     self.assertTrue(is_valid('ab*INGT1234b', dl_state))
     self.assertFalse(is_valid('ab123', dl_state))
     self.assertFalse(is_valid('a123456', dl_state))
     self.assertFalse(is_valid('abcd123456789', dl_state))
Exemplo n.º 55
0
 def test_new_york(self):
     dl_state = 'NY'
     self.assertTrue(is_valid('123456789', dl_state))
     self.assertTrue(is_valid('A123456789012345678', dl_state))
     self.assertFalse(is_valid('12345678', dl_state))
     self.assertFalse(is_valid('1234567890123456', dl_state))
     self.assertFalse(is_valid('a1234567', dl_state))
     self.assertFalse(is_valid('NEWaYORK', dl_state))
     self.assertFalse(is_valid('123456', dl_state))
Exemplo n.º 56
0
 def test_florida(self):
     dl_state = 'FL'
     self.assertFalse(is_valid('1234567', dl_state))
     self.assertTrue(is_valid('a123456789012', dl_state))
     self.assertTrue(is_valid('C123456789012', dl_state))
     self.assertTrue(is_valid('a12', dl_state))
     self.assertTrue(is_valid('a1234567890', dl_state))
     self.assertFalse(is_valid('ab1234567', dl_state))
Exemplo n.º 57
0
 def test_virginia(self):
     dl_state = 'VA'
     self.assertTrue(is_valid('123456789', dl_state))
     self.assertTrue(is_valid('a12345678', dl_state))
     self.assertTrue(is_valid('V12345678', dl_state))
     self.assertFalse(is_valid('ab123', dl_state))
     self.assertFalse(is_valid('a123456', dl_state))
     self.assertFalse(is_valid('1234567890123', dl_state))
Exemplo n.º 58
0
 def test_florida(self):
     dl_state = 'FL'
     self.assertFalse(is_valid('1234567', dl_state))
     self.assertTrue(is_valid('a123456789012', dl_state))
     self.assertTrue(is_valid('C123456789012', dl_state))
     self.assertTrue(is_valid('a12', dl_state))
     self.assertTrue(is_valid('a1234567890', dl_state))
     self.assertFalse(is_valid('ab1234567', dl_state))
Exemplo n.º 59
0
 def test_virginia(self):
     dl_state = 'VA'
     self.assertTrue(is_valid('123456789', dl_state))
     self.assertTrue(is_valid('a12345678', dl_state))
     self.assertTrue(is_valid('V12345678', dl_state))
     self.assertFalse(is_valid('ab123', dl_state))
     self.assertFalse(is_valid('a123456', dl_state))
     self.assertFalse(is_valid('1234567890123', dl_state))
Exemplo n.º 60
0
 def test_vermont(self):
     dl_state = 'VT'
     self.assertTrue(is_valid('12345678', dl_state))
     self.assertTrue(is_valid('1234567a', dl_state))
     self.assertTrue(is_valid('1234567A', dl_state))
     self.assertFalse(is_valid('ab123', dl_state))
     self.assertFalse(is_valid('a123456', dl_state))
     self.assertFalse(is_valid('1234567890123', dl_state))