8000 wip · arthurdejong/python-stdnum@5d182b5 · GitHub
[go: up one dir, main page]

Skip to content

Commit 5d182b5

Browse files
committed
wip
1 parent cccd161 commit 5d182b5

File tree

2 files changed

+6
-7
lines changed

2 files changed

+6
-7
lines changed

stdnum/vatin.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -66,12 +66,11 @@ def _get_cc_module(cc):
6666
# Greece uses a "wrong" country code, special case for Northern Ireland
6767
cc = cc.lower().replace('el', 'gr').replace('xi', 'gb')
6868
if not _country_code_re.match(cc):
69-
raise ImportError('Wrong "{}" country code.'.format(cc))
69+
raise ImportError('Wrong country code.')
7070
if cc not in _country_modules:
7171
_country_modules[cc] = get_cc_module(cc, 'vat')
7272
if not _country_modules[cc]:
73-
raise ImportError('Missing validation for "{}" country code.'
74-
''.format(cc))
73+
raise ImportError('Missing validation for country code.')
7574
return _country_modules[cc]
7675

7776

tests/test_vatin.doctest

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -61,23 +61,23 @@ Try validating not specifying a country:
6161
>>> vatin.validate('')
6262
Traceback (most recent call last):
6363
...
64-
ImportError: ...
64+
ImportError: Wrong country code.
6565
>>> vatin.validate('00')
6666
Traceback (most recent call last):
6767
...
68-
ImportError: ...
68+
ImportError: Wrong country code.
6969

7070

7171
Try to validate for countries with no VAT validation:
7272

7373
>>> vatin.validate('XX')
7474
Traceback (most recent call last):
7575
...
76-
ImportError: ...
76+
ImportError: Missing validation for country code.
7777
>>> vatin.validate('US')
7878
Traceback (most recent call last):
7979
...
80-
ImportError: ...
80+
ImportError: Missing validation for country code.
8181

8282

8383
Check is_valid for several scenarios:

0 commit comments

Comments
 (0)
0