python-stdnum branch master updated. 1.8.1-24-ge200656
[
Date Prev][
Date Next]
[
Thread Prev][
Thread Next]
python-stdnum branch master updated. 1.8.1-24-ge200656
- From: Commits of the python-stdnum project <python-stdnum-commits [at] lists.arthurdejong.org>
- To: python-stdnum-commits [at] lists.arthurdejong.org
- Reply-to: python-stdnum-users [at] lists.arthurdejong.org
- Subject: python-stdnum branch master updated. 1.8.1-24-ge200656
- Date: Thu, 12 Apr 2018 18:52:50 +0200 (CEST)
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "python-stdnum".
The branch, master has been updated
via e200656d89de638b716d24da928bc57bc41b9e3e (commit)
from e6739be9b4cebf01e331c6aaf075f49843883478 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
https://arthurdejong.org/git/python-stdnum/commit/?id=e200656d89de638b716d24da928bc57bc41b9e3e
commit e200656d89de638b716d24da928bc57bc41b9e3e
Author: Arthur de Jong <arthur@arthurdejong.org>
Date: Thu Apr 12 18:42:52 2018 +0200
Add an extra test for Belgian IBANs
A Belgian IBAN should not end with 00. This also fixes a docstring and
comment in the IBAN module.
diff --git a/stdnum/iban.py b/stdnum/iban.py
index 865b96c..09c8fdb 100644
--- a/stdnum/iban.py
+++ b/stdnum/iban.py
@@ -89,8 +89,7 @@ def _struct_to_re(structure):
def _get_cc_module(cc):
- """Get the VAT number module based on the country code."""
- # Greece uses a "wrong" country code
+ """Get the IBAN module based on the country code."""
cc = cc.lower()
if cc not in _country_modules:
_country_modules[cc] = get_cc_module(cc, 'iban')
diff --git a/tests/test_be_iban.doctest b/tests/test_be_iban.doctest
index 768b08a..023f05b 100644
--- a/tests/test_be_iban.doctest
+++ b/tests/test_be_iban.doctest
@@ -26,6 +26,17 @@ useful as module documentation.
>>> from stdnum.be import iban
+An IBAN should not end in 00 but should end with 97 instead to have a valid
+checksum.
+
+>>> iban.validate('BE54310100270097')
+'BE54310100270097'
+>>> iban.validate('BE54310100270000')
+Traceback (most recent call last):
+ ...
+InvalidChecksum: ...
+
+
These should all be valid numbers combined with the appropriate BIC code for
the IBAN.
-----------------------------------------------------------------------
Summary of changes:
stdnum/iban.py | 3 +--
tests/test_be_iban.doctest | 11 +++++++++++
2 files changed, 12 insertions(+), 2 deletions(-)
hooks/post-receive
--
python-stdnum
--
To unsubscribe send an email to
python-stdnum-commits-unsubscribe@lists.arthurdejong.org or see
https://lists.arthurdejong.org/python-stdnum-commits/
- python-stdnum branch master updated. 1.8.1-24-ge200656,
Commits of the python-stdnum project