From 02186014334be2cd2d8899835b8380ba1af74b7b Mon Sep 17 00:00:00 2001 From: Arthur de Jong Date: Sun, 17 Nov 2024 12:38:16 +0100 Subject: Allow Uruguay RUT number starting with 22 --- stdnum/uy/rut.py | 2 +- tests/test_uy_rut.doctest | 3 ++- 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)] -- cgit v1.2.3