fix(no_NO): compute Norwegian MOD11 check digit so iban() passes stdnum validation - #2415
Open
CedricConday wants to merge 4 commits into
Open
fix(no_NO): compute Norwegian MOD11 check digit so iban() passes stdnum validation#2415CedricConday wants to merge 4 commits into
CedricConday wants to merge 4 commits into
Conversation
fcurella
requested changes
Jul 22, 2026
|
|
||
| def test_iban_stdnum(self, faker, num_samples): | ||
| try: | ||
| from stdnum import iban as iban_validator |
Collaborator
There was a problem hiding this comment.
I'd rather add stdnum to the dev requirements and avoid the try ... except block
Adds python-stdnum to dev-requirements and hoists the import, so the IBAN validation test always runs rather than silently skipping on machines without it. Per review feedback on joke2k#2415. Co-Authored-By: Claude <noreply@anthropic.com> Assisted-by: Claude Opus 5
Contributor
Author
|
Done — One packaging note: the distribution is |
dev-requirements.txt is not what CI installs — the workflow runs tox, and [testenv] carries its own deps list. Without this the module-level stdnum import fails collection for the whole test_bank.py module. Co-Authored-By: Claude <noreply@anthropic.com> Assisted-by: Claude Opus 5
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Norwegian account numbers end in a MOD11 check digit; the no_NO provider generated it randomly, failing validation. This computes it correctly.
Verified against
python-stdnum(reference IBAN validator): 300/300 generated IBANs passstdnum.iban.validate(). Existingtests/providers/test_bank.pysuite passes. Includes a regression test.AI disclosure: Prepared with AI assistance (Claude / Claude Code). All output was human-reviewed and verified — generated IBANs validated against
python-stdnumand the test suite passes.