Arthur de Jong

Open Source / Free Software developer

summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorViggo de Vries <viggo@uwkm.nl>2021-01-04 12:47:12 +0100
committerArthur de Jong <arthur@arthurdejong.org>2021-01-10 15:30:19 +0100
commit0427b01985058cc01389b40df9f9bad61e547f9c (patch)
tree234c9f065ebd4bf0681faa32e76aa18d4ca0f0b9
parent2f2c7427ed8126709f777a108c2cf67e50d4fc7f (diff)
Remove GB from EU member states
Closes https://github.com/arthurdejong/python-stdnum/pull/246
-rw-r--r--stdnum/eu/vat.py6
-rw-r--r--tests/test_eu_vat.doctest40
-rw-r--r--tests/test_gb_vat.doctest46
3 files changed, 49 insertions, 43 deletions
diff --git a/stdnum/eu/vat.py b/stdnum/eu/vat.py
index 27d47c6..a57948b 100644
--- a/stdnum/eu/vat.py
+++ b/stdnum/eu/vat.py
@@ -44,9 +44,9 @@ from stdnum.util import clean, get_cc_module, get_soap_client
MEMBER_STATES = set([
- 'at', 'be', 'bg', 'cy', 'cz', 'de', 'dk', 'ee', 'es', 'fi', 'fr', 'gb',
- 'gr', 'hr', 'hu', 'ie', 'it', 'lt', 'lu', 'lv', 'mt', 'nl', 'pl', 'pt',
- 'ro', 'se', 'si', 'sk',
+ 'at', 'be', 'bg', 'cy', 'cz', 'de', 'dk', 'ee', 'es', 'fi', 'fr', 'gr',
+ 'hr', 'hu', 'ie', 'it', 'lt', 'lu', 'lv', 'mt', 'nl', 'pl', 'pt', 'ro',
+ 'se', 'si', 'sk',
])
"""The collection of country codes that are queried. Greece is listed with
a country code of gr while for VAT purposes el is used instead."""
diff --git a/tests/test_eu_vat.doctest b/tests/test_eu_vat.doctest
index 362f1de..7e9f258 100644
--- a/tests/test_eu_vat.doctest
+++ b/tests/test_eu_vat.doctest
@@ -347,46 +347,6 @@ These have been found online and should all be valid numbers.
... FR88000053537
... FR96000110899
...
-... GB 002 4257 28
-... GB 003232345
-... GB 100 1950 75
-... GB 100190874
-... GB 102675046
-... GB 232177091
-... GB 242338087388
-... GB 311 405 025
-... GB 362 5866 29
-... GB 417 2280 71
-... GB 436 0630 72
-... GB 495 2781 05
-... GB 507 5768 25
-... GB 521 6763 52
-... GB 586 367 295
-... GB 591 9373 01
-... GB 605 8678 15
-... GB 662 8564 06
-... GB 698 550 577
-... GB 733 4428 41
-... GB 770 381 235
-... GB 784 9117 89
-... GB 808 6365 12
-... GB 812 8333 44
-... GB 818243334
-... GB 823 531 352
-... GB 829 9594 59
-... GB 845788960
-... GB 879 7056 62
-... GB 881 3758 91
-... GB 913 3041 68
-... GB 933210951
-... GB 975 8664 50
-... GB 977 4872 51
-... GB 980780684
-... GB 997 7094 44
-... GB260311213
-... GB653599494
-... GB974053902
-...
... HU -12509403
... HU 10672101
... HU 10766172
diff --git a/tests/test_gb_vat.doctest b/tests/test_gb_vat.doctest
index 151feb4..1196511 100644
--- a/tests/test_gb_vat.doctest
+++ b/tests/test_gb_vat.doctest
@@ -25,6 +25,52 @@ really useful as module documentation.
>>> from stdnum.gb import vat
+>>> numbers = '''
+...
+... GB 002 4257 28
+... GB 003232345
+... GB 100 1950 75
+... GB 100190874
+... GB 102675046
+... GB 232177091
+... GB 242338087388
+... GB 311 405 025
+... GB 362 5866 29
+... GB 417 2280 71
+... GB 436 0630 72
+... GB 495 2781 05
+... GB 507 5768 25
+... GB 521 6763 52
+... GB 586 367 295
+... GB 591 9373 01
+... GB 605 8678 15
+... GB 662 8564 06
+... GB 698 550 577
+... GB 733 4428 41
+... GB 770 381 235
+... GB 784 9117 89
+... GB 808 6365 12
+... GB 812 8333 44
+... GB 818243334
+... GB 823 531 352
+... GB 829 9594 59
+... GB 845788960
+... GB 879 7056 62
+... GB 881 3758 91
+... GB 913 3041 68
+... GB 933210951
+... GB 975 8664 50
+... GB 977 4872 51
+... GB 980780684
+... GB 997 7094 44
+... GB260311213
+... GB653599494
+... GB974053902
+...
+... '''
+>>> [x for x in numbers.splitlines() if x and not vat.validate(x)]
+[]
+
Normal values that should just work.
>>> vat.validate('980780684') # standard number