summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorLuke Plant <L.Plant.98@cantab.net>2011-04-28 14:54:09 +0000
committerLuke Plant <L.Plant.98@cantab.net>2011-04-28 14:54:09 +0000
commitf459169170910c3d94ee916ed79e2b9ff48915a2 (patch)
tree91e58f42e24c796c84be37c75e6d6b02fadb4425 /tests
parent7b129a82b3418edba3e26fe654f303df184a3efc (diff)
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
Diffstat (limited to 'tests')
-rw-r--r--tests/regressiontests/admin_util/tests.py21
1 files changed, 21 insertions, 0 deletions
diff --git a/tests/regressiontests/admin_util/tests.py b/tests/regressiontests/admin_util/tests.py
index f4b3dd935d..ef34a5b026 100644
--- a/tests/regressiontests/admin_util/tests.py
+++ b/tests/regressiontests/admin_util/tests.py
@@ -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 ')
+ )