def test_number_credit_card_with_number_credit_card_validator_all_type(): card_type = random.choice(('visa13', 'visa16', 'visa19', 'mastercard', 'diners', 'jcb15', 'jcb16', 'discover')) value = fake.credit_card_number(card_type=card_type) ret = validators.credit_card(value, host=None) assert ret, value
def test_number_credit_card_with_host_invalid(): value = fake.credit_card_number() with pytest.raises(ValueError): assert validators.credit_card(value, host=fake.word())
def test_number_credit_card_with_number_invalid(): value = fake.text() ret = validators.credit_card(value, host=None) assert ret is None
def test_number_credit_card_with_number_credit_card_validator_if_card_type_jcb16( ): value = fake.credit_card_number(card_type='jcb16') ret = validators.credit_card(value, host='JCB') assert ret
def test_number_credit_card_with_number_credit_card_validator_if_card_type_discover( ): value = fake.credit_card_number(card_type='discover') ret = validators.credit_card(value, host='Discover') assert ret
def test_number_credit_card_with_number_credit_card_validator_if_card_type_diner_club( ): value = fake.credit_card_number(card_type='diners') ret = validators.credit_card(value, host='Diners Club') assert ret
def test_number_credit_card_with_number_credit_card_validator_if_card_type_master_card( ): value = fake.credit_card_number(card_type='mastercard') ret = validators.credit_card(value, host='Master Card') assert ret, value
def test_number_credit_card_with_number_credit_card_validator_if_card_type_visa_19( ): value = fake.credit_card_number(card_type='visa19') ret = validators.credit_card(value, host='Visa') assert ret