@@ -0,0 +1,1922 @@
+import unittest%0Afrom decimal import Decimal as D%0Afrom oscar_vat_moss.fields import *  # noqa%0Afrom django.core.exceptions import ValidationError%0A%0A%0Aclass VATINValidatorTest(unittest.TestCase):%0A    VALID_VATINS = (%0A        # VATIN         # Company name%0A        ('ATU66688202', 'hastexo Professional Services GmbH'),%0A        ('ATU66688202', 'HASTEXO PROFESSIONAL SERVICES GMBH'),%0A        ('ATU66688202', 'hastexo Professional Services GmbH (Procurement Department)'),%0A        )%0A    INVALID_VATINS = (%0A        # VATIN         # Incorrect company name%0A        ('ATU66688999', 'Example, Inc.'),%0A        ('ATU99999999', 'Acme, Inc'),%0A        )%0A%0A    def test_valid_vatin(self):%0A        validator = VATINValidator(None)%0A        for vatin, name in self.VALID_VATINS:%0A            # Just ensure this doesn't fail%0A            validator.validate_vatin(vatin)%0A            # validator is also callable%0A            validator(vatin)%0A%0A    def test_invalid_vatin(self):%0A        validator = VATINValidator(None)%0A        for vatin, name in self.INVALID_VATINS:%0A            with self.assertRaises(ValidationError):%0A                validator.validate_vatin(vatin)%0A%0A            with self.assertRaises(ValidationError):%0A                # validator is also callable%0A                validator(vatin)%0A%0A%0Aclass VATINFieldTest(unittest.TestCase):%0A    %0A    def test_default_properties(self):%0A        field = VATINField()%0A        validator_classes = %5B v.__class__ for v in field.validators %5D%0A        self.assertTrue(VATINValidator in validator_classes)%0A        self.assertEqual(field.max_length, DEFAULT_MAX_LENGTH)%0A%0A    def test_convenience_method(self):%0A        field = vatin()%0A        validator_classes = %5B v.__class__ for v in field.validators %5D%0A        self.assertTrue(VATINValidator in validator_classes)%0A        self.assertEqual(field.max_length, DEFAULT_MAX_LENGTH)%0A        self.assertEqual(field.name,'vatin')%0A        self.assertTrue(field.blank)%0A

Add unit tests for VATINField, VATINValidator