Welcome | Get started | Dive | Contribute | Topics | Reference | Changes | More
Adding IBAN numbers¶
This document describes the concepts implemented by the
lino_xl.lib.sepa
plugin.
Side note: Code snippets (lines starting with >>>
) in this document get
tested as part of our development workflow. The following
initialization snippet tells you which demo project is being used in
this document.
>>> from lino import startup
>>> startup('lino_book.projects.cosi1.settings')
>>> from lino.api.doctest import *
The following snippet tests whether all the fictuve IBAN samples are detected as valid by localflavor:
>>> from lino_xl.lib.sepa.fixtures.sample_ibans import IBANS
>>> from django.core.exceptions import ValidationError
>>> from localflavor.generic.validators import IBANValidator
>>> validate = IBANValidator()
>>> for i, iban in enumerate(IBANS):
... try:
... validate(iban)
... except ValidationError as e:
... print("{0}: {1} : {2}".format(i, iban, e))