diff options
| author | Tim Graham <timograham@gmail.com> | 2026-02-06 11:06:17 -0500 |
|---|---|---|
| committer | Jacob Walls <jacobtylerwalls@gmail.com> | 2026-02-10 16:04:24 -0500 |
| commit | d007fcf7291cc3c24d4545e23c759bde22b6a8a6 (patch) | |
| tree | 0ed3491b9e2e0d61694eff2535c99e1eded34b27 /tests/serializers | |
| parent | 64a4d8ad005721b17fafd3399bdf49d7d0f94455 (diff) | |
Modified tests to format PKs with %s rather than %d.
It's how Django formats values internally and makes tests compatible
with databases that use non-integer primary keys.
Diffstat (limited to 'tests/serializers')
| -rw-r--r-- | tests/serializers/test_data.py | 4 | ||||
| -rw-r--r-- | tests/serializers/test_natural.py | 2 |
2 files changed, 3 insertions, 3 deletions
diff --git a/tests/serializers/test_data.py b/tests/serializers/test_data.py index 121404a0ef..744c9d1a2b 100644 --- a/tests/serializers/test_data.py +++ b/tests/serializers/test_data.py @@ -170,7 +170,7 @@ def data_compare(testcase, pk, klass, data): testcase.assertEqual( bytes(data), bytes(instance.data), - "Objects with PK=%d not equal; expected '%s' (%s), got '%s' (%s)" + "Objects with PK=%s not equal; expected '%s' (%s), got '%s' (%s)" % ( pk, repr(bytes(data)), @@ -183,7 +183,7 @@ def data_compare(testcase, pk, klass, data): testcase.assertEqual( data, instance.data, - "Objects with PK=%d not equal; expected '%s' (%s), got '%s' (%s)" + "Objects with PK=%s not equal; expected '%s' (%s), got '%s' (%s)" % ( pk, data, diff --git a/tests/serializers/test_natural.py b/tests/serializers/test_natural.py index e5592f97c8..b405dc3e28 100644 --- a/tests/serializers/test_natural.py +++ b/tests/serializers/test_natural.py @@ -44,7 +44,7 @@ def natural_key_serializer_test(self, format): self.assertEqual( obj.data, instance.data, - "Objects with PK=%d not equal; expected '%s' (%s), got '%s' (%s)" + "Objects with PK=%s not equal; expected '%s' (%s), got '%s' (%s)" % ( obj.pk, obj.data, |
