summaryrefslogtreecommitdiff
path: root/tests/str
diff options
context:
space:
mode:
authorCollin Anderson <cmawebsite@gmail.com>2017-04-08 14:38:48 -0400
committerTim Graham <timograham@gmail.com>2017-06-09 13:42:53 -0400
commit1a49b8947033fd667310b1b996330a8e119fcbf9 (patch)
treec6c1154a617e21e0539ef9f8214c0013ce9fb742 /tests/str
parent7c9cb1ed37354c184fe0438ecae923d5be711c86 (diff)
downloaddjango-1a49b8947033fd667310b1b996330a8e119fcbf9.tar.gz
Fixed #27953 -- Added instance's pk to Model.__str__().
Diffstat (limited to 'tests/str')
-rw-r--r--tests/str/tests.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/tests/str/tests.py b/tests/str/tests.py
index db21ccb2d9..181906fa0d 100644
--- a/tests/str/tests.py
+++ b/tests/str/tests.py
@@ -30,5 +30,8 @@ class SimpleTests(TestCase):
# coerce the returned value.
self.assertIsInstance(obj.__str__(), str)
self.assertIsInstance(obj.__repr__(), str)
- self.assertEqual(str(obj), 'Default object')
- self.assertEqual(repr(obj), '<Default: Default object>')
+ self.assertEqual(str(obj), 'Default object (None)')
+ self.assertEqual(repr(obj), '<Default: Default object (None)>')
+ obj2 = Default(pk=100)
+ self.assertEqual(str(obj2), 'Default object (100)')
+ self.assertEqual(repr(obj2), '<Default: Default object (100)>')