Arthur de Jong

Open Source / Free Software developer

summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorArthur de Jong <arthur@arthurdejong.org>2024-11-17 12:38:16 +0100
committerArthur de Jong <arthur@arthurdejong.org>2024-11-17 12:39:10 +0100
commit02186014334be2cd2d8899835b8380ba1af74b7b (patch)
treedadb95a2234586c05291925e1632289343585b9a
parentbcd5018ee6842a13b07b168c6bc01c5d28c87406 (diff)
Allow Uruguay RUT number starting with 22HEADmaster
-rw-r--r--stdnum/uy/rut.py2
-rw-r--r--tests/test_uy_rut.doctest3
2 files changed, 3 insertions, 2 deletions
diff --git a/stdnum/uy/rut.py b/stdnum/uy/rut.py
index baf6322..769578d 100644
--- a/stdnum/uy/rut.py
+++ b/stdnum/uy/rut.py
@@ -87,7 +87,7 @@ def validate(number):
raise InvalidLength()
if not isdigits(number):
raise InvalidFormat()
- if number[:2] < '01' or number[:2] > '21':
+ if number[:2] < '01' or number[:2] > '22':
raise InvalidComponent()
if number[2:8] == '000000':
raise InvalidComponent()
diff --git a/tests/test_uy_rut.doctest b/tests/test_uy_rut.doctest
index 0458389..784690e 100644
--- a/tests/test_uy_rut.doctest
+++ b/tests/test_uy_rut.doctest
@@ -47,7 +47,7 @@ InvalidFormat: ...
Traceback (most recent call last):
...
InvalidComponent: ...
->>> rut.validate('221599340019') # invalid first two digits
+>>> rut.validate('991599340011') # invalid first two digits
Traceback (most recent call last):
...
InvalidComponent: ...
@@ -269,6 +269,7 @@ These have been found online and should all be valid numbers.
... 217132510011
... 217142440016
... 217149110011
+... 220018800014
...
... '''
>>> [x for x in numbers.splitlines() if x and not rut.is_valid(x)]