diff --git a/service_objects/celery_services.py b/service_objects/celery_services.py index 0b44374..3795c7f 100644 --- a/service_objects/celery_services.py +++ b/service_objects/celery_services.py @@ -20,7 +20,7 @@ def _deflate_model(value): Transforms model instances into picklable tuple. """ if isinstance(value, models.Model): - return (value.__class__, value.pk) + return value.__class__, value.pk return value @staticmethod diff --git a/tests/test_celery_services.py b/tests/test_celery_services.py index 4bc1fc3..c7c14eb 100644 --- a/tests/test_celery_services.py +++ b/tests/test_celery_services.py @@ -30,11 +30,11 @@ def test_cleaned_data_pickling(self): service.is_valid() # Check deflated ModelField format - defalted_models = self.initial_data.copy() - defalted_models["foo"] = (CustomFooModel, self.foo.pk) + deflated_models = self.initial_data.copy() + deflated_models["foo"] = (CustomFooModel, self.foo.pk) self.assertEqual( - CeleryService._deflate_models(service.cleaned_data), defalted_models + CeleryService._deflate_models(service.cleaned_data), deflated_models ) # Check deflate/inflate invariant