diff --git a/chamber/commands/__init__.py b/chamber/commands/__init__.py index 3a69c10..43b1f1a 100644 --- a/chamber/commands/__init__.py +++ b/chamber/commands/__init__.py @@ -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, diff --git a/chamber/migrations/fixtures_south.py b/chamber/migrations/fixtures_south.py index b825a0b..d55845d 100644 --- a/chamber/migrations/fixtures_south.py +++ b/chamber/migrations/fixtures_south.py @@ -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 @@ -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) \ No newline at end of file + load_fixture(file, orm) diff --git a/example/dj/apps/test_chamber/tests/models/fields.py b/example/dj/apps/test_chamber/tests/models/fields.py index 5e2c947..297cb83 100644 --- a/example/dj/apps/test_chamber/tests/models/fields.py +++ b/example/dj/apps/test_chamber/tests/models/fields.py @@ -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 @@ -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() diff --git a/example/dj/apps/test_chamber/tests/utils/datastructures.py b/example/dj/apps/test_chamber/tests/utils/datastructures.py index a6719ea..4fbdc10 100644 --- a/example/dj/apps/test_chamber/tests/utils/datastructures.py +++ b/example/dj/apps/test_chamber/tests/utils/datastructures.py @@ -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):