コード例 #1
0
    def validate(self, value: IBAN):
        """Validate the IBAN value.

        Warning: Some invalid IBANs can pass this validation.
        Specifically, the SWIFT/BIC number of the bank is
        not verified to be valid. A crafted IBAN value
        with a correct checksum but fake BIC slip through.

        Args:
            value: The IBAN value to validate.
        """
        errors = super().validate(value)
        try:
            value.validate()
        except ValueError as err:
            errors.append(f'IBAN INVALID: {err}')

        return errors
コード例 #2
0
def test_parse_iban_allow_invalid(number):
    iban = IBAN(number, allow_invalid=True)
    with pytest.raises(SchwiftyException):
        iban.validate()
コード例 #3
0
def test_parse_iban_allow_invalid(number):
    iban = IBAN(number, allow_invalid=True)
    with pytest.raises(ValueError):
        iban.validate()
コード例 #4
0
ファイル: test_iban.py プロジェクト: figo-connect/schwifty
def test_parse_iban_allow_invalid(number):
    iban = IBAN(number, allow_invalid=True)
    with pytest.raises(ValueError):
        iban.validate()