Skip to content

Commit

Permalink
Fixed few Codacy warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
LukasRychtecky committed Jan 1, 2017
1 parent 0cc40c4 commit 2651f8d
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 8 deletions.
2 changes: 1 addition & 1 deletion chamber/commands/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ def _post_import_rows(self, created_count, updated_count=0):

class ImportCSVCommand(ImportCSVCommandMixin, CSVImporter, BaseCommand):

def _post_import_rows(self, created_count, updated_count):
def _post_import_rows(self, created_count, updated_count=0):
self.stdout.write('Created {created} {model_name} and {updated} updated.'.format(
created=created_count,
model_name=self.model_class._meta.verbose_name_plural,
Expand Down
4 changes: 2 additions & 2 deletions chamber/migrations/fixtures_south.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ def load_fixture(file_name, orm):
def get_model_southern_style(*args):
try:
return orm['.'.join(args)]
except:
except KeyError:
return original_get_model(*args)

models.get_model = get_model_southern_style
Expand All @@ -34,4 +34,4 @@ def load_fixture_of_migration(migration, orm, fixture_type='json'):
file = os.path.join(fixture_dir, fixture_filename)
if not os.path.isfile(file):
raise IOError('File "%s" does not exists' % file)
load_fixture(file, orm)
load_fixture(file, orm)
5 changes: 2 additions & 3 deletions example/dj/apps/test_chamber/tests/models/fields.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
from django.core.exceptions import ValidationError
from django.test import TransactionTestCase

from chamber.shortcuts import change_and_save
from chamber.models.fields import generate_random_upload_path
from germanium.tools import assert_equal, assert_raises, assert_true, assert_false, assert_is_none
from germanium.tools import assert_equal, assert_raises, assert_true, assert_is_none

from chamber.exceptions import PersistenceException

Expand All @@ -14,7 +13,7 @@ class ModelFieldsTestCase(TransactionTestCase):

def setUp(self):
self.inst = TestFieldsModel()
super(TransactionTestCase, self).setUp()
super(ModelFieldsTestCase, self).setUp()

def test_random_file_path_should_be_generated_from_class_name(self):
instance = CSVRecord()
Expand Down
4 changes: 2 additions & 2 deletions example/dj/apps/test_chamber/tests/utils/datastructures.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

from django.test import TestCase

from germanium.tools import assert_equal, assert_raises
from chamber.utils.datastructures import (ChoicesEnum, ChoicesNumEnum, Enum, NumEnum, OrderedSet)

from chamber.utils.datastructures import Enum, NumEnum, ChoicesEnum, ChoicesNumEnum, OrderedSet
from germanium.tools import assert_equal, assert_raises


class DatastructuresTestCase(TestCase):
Expand Down

0 comments on commit 2651f8d

Please sign in to comment.