fix: do not assign simple/supported fields in Importer constructor
subclass may define those and we do not want to overwrite; in some cases doing so would cause error (if subclass defines a property)
This commit is contained in:
parent
4f68a2f360
commit
65bbc95ae2
2 changed files with 0 additions and 4 deletions
|
@ -200,8 +200,6 @@ class Importer:
|
||||||
|
|
||||||
self.__dict__.update(kwargs)
|
self.__dict__.update(kwargs)
|
||||||
|
|
||||||
self.simple_fields = self.get_simple_fields()
|
|
||||||
self.supported_fields = self.get_supported_fields()
|
|
||||||
self.fields = self.get_fields()
|
self.fields = self.get_fields()
|
||||||
|
|
||||||
# fields could be comma-delimited string from cli param
|
# fields could be comma-delimited string from cli param
|
||||||
|
|
|
@ -24,8 +24,6 @@ class TestImporter(DataTestCase):
|
||||||
imp = self.make_importer(model_class=model.Setting)
|
imp = self.make_importer(model_class=model.Setting)
|
||||||
|
|
||||||
# fields
|
# fields
|
||||||
self.assertEqual(imp.supported_fields, ['name', 'value'])
|
|
||||||
self.assertEqual(imp.simple_fields, ['name', 'value'])
|
|
||||||
self.assertEqual(imp.fields, ['name', 'value'])
|
self.assertEqual(imp.fields, ['name', 'value'])
|
||||||
|
|
||||||
# orientation etc.
|
# orientation etc.
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue