Exemplo n.º 1
0
 def test_has_iin(self):
     card = Card(number='4' + '1' * 15)
     assert (len(card.iin) == 6)
     assert (card.iin == '411111')
Exemplo n.º 2
0
 def test_visa(self):
     assert len(V) > 1  # Make sure Visa is defined
     assert Card(number='400000000').network == V
Exemplo n.º 3
0
 def test_visa_411(self):
     assert Card(
         number='4' + '1' * 15
     ).network == V, "Standard Visa test number should be recognized as Visa"
Exemplo n.º 4
0
 def test_lowerbound(self):
     assert Card(number='222099').network is None
Exemplo n.º 5
0
 def test_upperbound(self):
     assert Card(number='999999').network is None
Exemplo n.º 6
0
 def test_invalid(self):
     card = Card(number='4' + '1' * 14 + '0')
     assert (not card.valid)
Exemplo n.º 7
0
 def test_lower_mc(self):
     lowest_mc = '222100'
     assert len(MC) > 1  # Make sure Mastercard is defined
     assert Card(number=lowest_mc).network == MC
Exemplo n.º 8
0
 def test_valid(self):
     card = Card(number='4' + '1' * 15)
     assert (card.valid)
Exemplo n.º 9
0
 def test_pan_excludes_checksum(self):
     card = Card(number='52' * 8)
     assert (card.pan[-1] != '2'), "PAN should not include checksum"
     assert (card.pan[-1] == '5')
Exemplo n.º 10
0
 def test_has_pan(self):
     card = Card(number='4' + '1' * 15)
     assert (
         card.pan == '1' * 9
     ), "PAN should be 9 digits long. IIN is 6 digits and don't add checksum to PAN"
Exemplo n.º 11
0
 def test_has_description(self):
     card = Card(number='4' + '1' * 15)
     assert (card.mii_description == 'Banking and financial')
Exemplo n.º 12
0
 def test_has_mii(self):
     card = Card(number='4' + '1' * 15)
     assert (card.mii == '4')