Arthur de Jong

Open Source / Free Software developer

summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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)]