diff options
| author | Tim Graham <timograham@gmail.com> | 2016-04-07 22:04:45 -0400 |
|---|---|---|
| committer | Tim Graham <timograham@gmail.com> | 2016-04-08 10:12:33 -0400 |
| commit | 92053acbb9160862c3e743a99ed8ccff8d4f8fd6 (patch) | |
| tree | 50e7fd28a650f0e2352cf94f92e5a66d28a81988 /tests/serializers/test_natural.py | |
| parent | df8d8d4292684d6ffa7474f1e201aed486f02b53 (diff) | |
Fixed E128 flake8 warnings in tests/.
Diffstat (limited to 'tests/serializers/test_natural.py')
| -rw-r--r-- | tests/serializers/test_natural.py | 24 |
1 files changed, 14 insertions, 10 deletions
diff --git a/tests/serializers/test_natural.py b/tests/serializers/test_natural.py index 6682e5cdd8..8f4d00d5a6 100644 --- a/tests/serializers/test_natural.py +++ b/tests/serializers/test_natural.py @@ -21,8 +21,7 @@ def natural_key_serializer_test(format, self): FKDataNaturalKey.objects.create(id=1102, data_id=None), ] # Serialize the test database - serialized_data = serializers.serialize(format, objects, indent=2, - use_natural_foreign_keys=True) + serialized_data = serializers.serialize(format, objects, indent=2, use_natural_foreign_keys=True) for obj in serializers.deserialize(format, serialized_data): obj.save() @@ -31,15 +30,19 @@ def natural_key_serializer_test(format, self): # as the original source for obj in objects: instance = obj.__class__.objects.get(id=obj.pk) - self.assertEqual(obj.data, instance.data, - "Objects with PK=%d not equal; expected '%s' (%s), got '%s' (%s)" % ( - obj.pk, obj.data, type(obj.data), instance, type(instance.data)) + self.assertEqual( + obj.data, instance.data, + "Objects with PK=%d not equal; expected '%s' (%s), got '%s' (%s)" % ( + obj.pk, obj.data, type(obj.data), instance, type(instance.data), + ) ) def natural_key_test(format, self): - book1 = {'data': '978-1590597255', 'title': 'The Definitive Guide to ' - 'Django: Web Development Done Right'} + book1 = { + 'data': '978-1590597255', + 'title': 'The Definitive Guide to Django: Web Development Done Right', + } book2 = {'data': '978-1590599969', 'title': 'Practical Django Projects'} # Create the books. @@ -47,9 +50,10 @@ def natural_key_test(format, self): james = NaturalKeyAnchor.objects.create(**book2) # Serialize the books. - string_data = serializers.serialize(format, NaturalKeyAnchor.objects.all(), - indent=2, use_natural_foreign_keys=True, - use_natural_primary_keys=True) + string_data = serializers.serialize( + format, NaturalKeyAnchor.objects.all(), indent=2, + use_natural_foreign_keys=True, use_natural_primary_keys=True, + ) # Delete one book (to prove that the natural key generation will only # restore the primary keys of books found in the database via the |
