Skip to content

Commit 475c736

Browse files
authored
Register ISO 7064 mod 97-10 checksum for BA, not BT (#264) (#292)
1 parent 0723be1 commit 475c736

3 files changed

Lines changed: 17 additions & 2 deletions

File tree

CHANGELOG.rst

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,14 @@ Changelog
55

66
Versions follow `CalVer <http://www.calver.org/>`_ with the scheme ``YY.0M.Micro``.
77

8+
Unreleased
9+
----------
10+
Fixed
11+
~~~~~
12+
* Registered the ISO 7064 mod 97-10 national checksum algorithm for Bosnia and
13+
Herzegovina (``BA``) instead of ``BT`` (Bhutan, which has no IBAN), so the
14+
national checksum of ``BA`` IBANs is now validated (#264).
15+
816
`2026.03.0`_ - 2026/03/04
917
-------------------------
1018
Added
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
from schwifty import checksum
22

33

4-
# Bosnia and Herzegovina (BT)
4+
# Bosnia and Herzegovina (BA)
55
# Montenegro (ME)
66
# North Macedonia (MK)
77
# Portugal (PT)
88
# Serbia (RS)
99
# Slovenia (SI)
1010
# East Timor (TL)
11-
@checksum.register("BT", "ME", "MK", "PT", "RS", "SI", "TL")
11+
@checksum.register("BA", "ME", "MK", "PT", "RS", "SI", "TL")
1212
class DefaultAlgorithm(checksum.ISO7064_mod97_10):
1313
name = "default"

tests/test_bban.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,13 @@ def test_validate_national_checksum() -> None:
1515
with pytest.raises(InvalidBBANChecksum):
1616
BBAN("BE", "539007547035").validate_national_checksum()
1717

18+
# Bosnia and Herzegovina (BA) uses ISO 7064 mod 97-10; it was previously
19+
# registered under the wrong country code "BT" (#264), so the national
20+
# checksum was never validated.
21+
assert BBAN("BA", "1290079401028494").validate_national_checksum() is True
22+
with pytest.raises(InvalidBBANChecksum):
23+
BBAN("BA", "1290079401028400").validate_national_checksum()
24+
1825

1926
@pytest.mark.parametrize("country_code", ["DE", "ES", "GB", "FR", "PL"])
2027
def test_random(country_code: str) -> None:

0 commit comments

Comments
 (0)