File tree Expand file tree Collapse file tree 2 files changed +6
-7
lines changed Expand file tree Collapse file tree 2 files changed +6
-7
lines changed Original file line number Diff line number Diff line change @@ -66,12 +66,11 @@ def _get_cc_module(cc):
66
66
# Greece uses a "wrong" country code, special case for Northern Ireland
67
67
cc = cc .lower ().replace ('el' , 'gr' ).replace ('xi' , 'gb' )
68
68
if not _country_code_re .match (cc ):
69
- raise ImportError ('Wrong "{}" country code.' . format ( cc ) )
69
+ raise ImportError ('Wrong country code.' )
70
70
if cc not in _country_modules :
71
71
_country_modules [cc ] = get_cc_module (cc , 'vat' )
72
72
if not _country_modules [cc ]:
73
- raise ImportError ('Missing validation for "{}" country code.'
74
- '' .format (cc ))
73
+ raise ImportError ('Missing validation for country code.' )
75
74
return _country_modules [cc ]
76
75
77
76
Original file line number Diff line number Diff line change @@ -61,23 +61,23 @@ Try validating not specifying a country:
61
61
>>> vatin.validate('')
62
62
Traceback (most recent call last):
63
63
...
64
- ImportError: .. .
64
+ ImportError: Wrong country code .
65
65
>>> vatin.validate('00')
66
66
Traceback (most recent call last):
67
67
...
68
- ImportError: .. .
68
+ ImportError: Wrong country code .
69
69
70
70
71
71
Try to validate for countries with no VAT validation:
72
72
73
73
>>> vatin.validate('XX')
74
74
Traceback (most recent call last):
75
75
...
76
- ImportError: .. .
76
+ ImportError: Missing validation for country code .
77
77
>>> vatin.validate('US')
78
78
Traceback (most recent call last):
79
79
...
80
- ImportError: .. .
80
+ ImportError: Missing validation for country code .
81
81
82
82
83
83
Check is_valid for several scenarios:
You can’t perform that action at this time.
0 commit comments