Skip to content

Commit

Permalink
Moved IBAN deconstruct test to correct class.
Browse files Browse the repository at this point in the history
  • Loading branch information
benkonrath committed Jul 21, 2017
1 parent 72e5ce8 commit b0fe8da
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions tests/test_generic/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -292,6 +292,14 @@ def test_default_form(self):
iban_model_field = IBANField()
self.assertEqual(type(iban_model_field.formfield()), type(IBANFormField()))

def test_model_field_deconstruct(self):
# test_instance must be created with the non-default options.
test_instance = IBANField(include_countries=('NL', 'BE'), use_nordea_extensions=True)
name, path, args, kwargs = test_instance.deconstruct()
new_instance = IBANField(*args, **kwargs)
for attr in ('include_countries', 'use_nordea_extensions'):
self.assertEqual(getattr(test_instance, attr), getattr(new_instance, attr))


class BICTests(TestCase):
def test_bic_validator(self):
Expand Down Expand Up @@ -450,11 +458,3 @@ def test_ean_validator_strip_nondigits(self):

for value in invalid:
self.assertRaisesMessage(ValidationError, error_message, validator, value)

def test_deconstruct_methods(self):
# test_instance must be created with the non-default options.
test_instance = IBANField(include_countries=('NL', 'BE'), use_nordea_extensions=True)
name, path, args, kwargs = test_instance.deconstruct()
new_instance = IBANField(*args, **kwargs)
for attr in ('include_countries', 'use_nordea_extensions'):
self.assertEqual(getattr(test_instance, attr), getattr(new_instance, attr))

0 comments on commit b0fe8da

Please sign in to comment.