1
0
mirror of https://github.com/django/django.git synced 2025-10-24 06:06:09 +00:00

Fixed #15661 - LogEntry objects have no unicode method

Thanks to Keryn Knight for the report and initial patch, and ShawnMilo for
additional work on the patch.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@16120 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
Luke Plant
2011-04-28 14:54:09 +00:00
parent 7b129a82b3
commit f459169170
2 changed files with 33 additions and 1 deletions

View File

@@ -235,3 +235,24 @@ class UtilTests(unittest.TestCase):
label_for_field('guest', Event, return_attr=True),
('awesome guest', None),
)
def test_logentry_unicode(self):
"""
Regression test for #15661
"""
log_entry = admin.models.LogEntry()
log_entry.action_flag = admin.models.ADDITION
self.assertTrue(
unicode(log_entry).startswith('Added ')
)
log_entry.action_flag = admin.models.CHANGE
self.assertTrue(
unicode(log_entry).startswith('Changed ')
)
log_entry.action_flag = admin.models.DELETION
self.assertTrue(
unicode(log_entry).startswith('Deleted ')
)