valdergallo / data-importer

Django Data Importer
https://django-data-importer.readthedocs.org/
Other
66 stars 32 forks source link

correctios #78

Closed loco0321 closed 8 years ago

loco0321 commented 8 years ago

show more information in indexError change method to static correction alphabetic

valdergallo commented 8 years ago

Hi, man ... I´m back this patch is creating one bug in dict method

    def test_exclude_with_tupla(self):
        class TestMeta(CSVImporter):
                fields = {
                    'test_field': 0,
                    'test_number_field': 'A',
                    'test3_field': 'b',
                }

                class Meta:
                    exclude = ('test3_field',)
                    delimiter = ','
                    raise_errors = True
                    ignore_first_line = True

                def clean_test_field(self, value):
                    return str(value).upper()

        self.source_content.seek(0)
        importer = TestMeta(source=self.source_content)
        self.assertTrue(importer.is_valid(), importer.errors)
        self.assertEquals(importer.cleaned_data[0],
                          (1, {'test_number_field': '1', 'test_field': 'TEST1'}),
>                         importer.cleaned_data[0])
E       AssertionError: (1, {'test_number_field': u'test1', 'test_field': '1'})