diff options
| author | django-bot <ops@djangoproject.com> | 2025-07-22 20:41:41 -0700 |
|---|---|---|
| committer | nessita <124304+nessita@users.noreply.github.com> | 2025-07-23 20:17:55 -0300 |
| commit | 69a93a88edb56ba47f624dac7a21aacc47ea474f (patch) | |
| tree | f57507a4435d032493cae40e06ecb254790b67b2 /tests/serializers | |
| parent | 55b0cc21310b76ce4018dd793ba50556eaf0af06 (diff) | |
Refs #36500 -- Rewrapped long docstrings and block comments via a script.
Rewrapped long docstrings and block comments to 79 characters + newline
using script from https://github.com/medmunds/autofix-w505.
Diffstat (limited to 'tests/serializers')
| -rw-r--r-- | tests/serializers/test_data.py | 4 | ||||
| -rw-r--r-- | tests/serializers/test_json.py | 3 | ||||
| -rw-r--r-- | tests/serializers/tests.py | 8 |
3 files changed, 10 insertions, 5 deletions
diff --git a/tests/serializers/test_data.py b/tests/serializers/test_data.py index 6a6de18033..c626f2550a 100644 --- a/tests/serializers/test_data.py +++ b/tests/serializers/test_data.py @@ -241,8 +241,8 @@ def inherited_compare(testcase, pk, klass, data): testcase.assertEqual(value, getattr(instance, key)) -# Define some test helpers. Each has a pair of functions: one to create objects and one -# to make assertions against objects of a particular type. +# Define some test helpers. Each has a pair of functions: one to create objects +# and one to make assertions against objects of a particular type. TestHelper = namedtuple("TestHelper", ["create_object", "compare_object"]) data_obj = TestHelper(data_create, data_compare) generic_obj = TestHelper(generic_create, generic_compare) diff --git a/tests/serializers/test_json.py b/tests/serializers/test_json.py index 65d521faac..2c8ad5708e 100644 --- a/tests/serializers/test_json.py +++ b/tests/serializers/test_json.py @@ -188,7 +188,8 @@ class JsonSerializerTestCase(SerializersTestBase, TestCase): def test_helpful_error_message_for_many2many_natural1(self): """ Invalid many-to-many keys should throw a helpful error message. - This tests the code path where one of a list of natural keys is invalid. + This tests the code path where one of a list of natural keys is + invalid. """ test_string = """[{ "pk": 1, diff --git a/tests/serializers/tests.py b/tests/serializers/tests.py index 04d6b4e9ee..4638cd93aa 100644 --- a/tests/serializers/tests.py +++ b/tests/serializers/tests.py @@ -391,7 +391,9 @@ class SerializersTestBase: self.assertEqual(Category.objects.count(), 5) def test_deterministic_mapping_ordering(self): - """Mapping such as fields should be deterministically ordered. (#24558)""" + """ + Mapping such as fields should be deterministically ordered. (#24558) + """ output = serializers.serialize(self.serializer_name, [self.a1], indent=2) categories = self.a1.categories.values_list("pk", flat=True) self.assertEqual( @@ -406,7 +408,9 @@ class SerializersTestBase: ) def test_deserialize_force_insert(self): - """Deserialized content can be saved with force_insert as a parameter.""" + """ + Deserialized content can be saved with force_insert as a parameter. + """ serial_str = serializers.serialize(self.serializer_name, [self.a1]) deserial_obj = list(serializers.deserialize(self.serializer_name, serial_str))[ 0 |
