mirror of
https://github.com/django/django.git
synced 2025-10-24 06:06:09 +00:00
Fixed #27953 -- Added instance's pk to Model.__str__().
This commit is contained in:
committed by
Tim Graham
parent
7c9cb1ed37
commit
1a49b89470
@@ -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)>')
|
||||
|
||||
Reference in New Issue
Block a user