Skip to content

Commit

Permalink
💄 update coding style
Browse files Browse the repository at this point in the history
  • Loading branch information
chfw committed Oct 31, 2020
1 parent 783bbb5 commit 98e0e76
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 9 deletions.
6 changes: 1 addition & 5 deletions pyexcel_io/database/importers/django.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,7 @@ def write_row(self, array):
model_to_be_created = self.initializer(new_array)
if model_to_be_created:
row = dict(zip(self.column_names, model_to_be_created))
self.objs.append(
self.model(
**row
)
)
self.objs.append(self.model(**row))

# else
# skip the row
Expand Down
11 changes: 7 additions & 4 deletions tests/test_django_book.py
Original file line number Diff line number Diff line change
Expand Up @@ -158,10 +158,13 @@ def wrapper(row):
writer = DjangoModelWriter(None, adapter)
writer.write_array(self.data[1:])
writer.close()
eq_(model.objects.objs, [
{"Y": 2, "X": 2, "Z": 3},
{"Y": 5, "X": 5, "Z": 6},
])
eq_(
model.objects.objs,
[
{"Y": 2, "X": 2, "Z": 3},
{"Y": 5, "X": 5, "Z": 6},
],
)

def test_sheet_save_to_django_model_skip_me(self):
model = FakeDjangoModel()
Expand Down

0 comments on commit 98e0e76

Please sign in to comment.