summaryrefslogtreecommitdiff
path: root/tests/many_to_one
diff options
context:
space:
mode:
authorTim Graham <timograham@gmail.com>2026-02-06 11:06:17 -0500
committerJacob Walls <jacobtylerwalls@gmail.com>2026-02-10 16:04:24 -0500
commitd007fcf7291cc3c24d4545e23c759bde22b6a8a6 (patch)
tree0ed3491b9e2e0d61694eff2535c99e1eded34b27 /tests/many_to_one
parent64a4d8ad005721b17fafd3399bdf49d7d0f94455 (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/many_to_one')
-rw-r--r--tests/many_to_one/tests.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/tests/many_to_one/tests.py b/tests/many_to_one/tests.py
index 4d2343e304..193e6e7086 100644
--- a/tests/many_to_one/tests.py
+++ b/tests/many_to_one/tests.py
@@ -889,7 +889,7 @@ class ManyToOneTests(TestCase):
def test_add_remove_set_by_pk_raises(self):
usa = Country.objects.create(name="United States")
chicago = City.objects.create(name="Chicago")
- msg = "'City' instance expected, got %s" % chicago.pk
+ msg = "'City' instance expected, got %r" % chicago.pk
with self.assertRaisesMessage(TypeError, msg):
usa.cities.add(chicago.pk)
with self.assertRaisesMessage(TypeError, msg):