diff options
author | Collin Anderson <cmawebsite@gmail.com> | 2017-04-08 14:38:48 -0400 |
---|---|---|
committer | Tim Graham <timograham@gmail.com> | 2017-06-09 13:42:53 -0400 |
commit | 1a49b8947033fd667310b1b996330a8e119fcbf9 (patch) | |
tree | c6c1154a617e21e0539ef9f8214c0013ce9fb742 /tests/str | |
parent | 7c9cb1ed37354c184fe0438ecae923d5be711c86 (diff) | |
download | django-1a49b8947033fd667310b1b996330a8e119fcbf9.tar.gz |
Fixed #27953 -- Added instance's pk to Model.__str__().
Diffstat (limited to 'tests/str')
-rw-r--r-- | tests/str/tests.py | 7 |
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)>') |