summaryrefslogtreecommitdiff
path: root/tests/admin_utils
diff options
context:
space:
mode:
authorAnton Samarchyan <anton.samarchyan@savoirfairelinux.com>2017-06-19 13:42:05 -0400
committerTim Graham <timograham@gmail.com>2017-06-19 14:12:38 -0400
commit0b9ccf9e607e31a056f9e0a41f3f79aefeff2e9d (patch)
tree594aea24cd33d155c6dfdc1edea3fe33da0ce11d /tests/admin_utils
parentfda55c71a8846364b9dc4f4efac4d7034ef6dd6f (diff)
Completed test coverage for admin's LogEntry model.
Diffstat (limited to 'tests/admin_utils')
-rw-r--r--tests/admin_utils/test_logentry.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/tests/admin_utils/test_logentry.py b/tests/admin_utils/test_logentry.py
index 09c09b0ea7..1cf0de349d 100644
--- a/tests/admin_utils/test_logentry.py
+++ b/tests/admin_utils/test_logentry.py
@@ -67,6 +67,11 @@ class LogEntryTests(TestCase):
with translation.override('fr'):
self.assertEqual(logentry.get_change_message(), 'Ajout.')
+ def test_logentry_change_message_not_json(self):
+ """LogEntry.change_message was a string before Django 1.10."""
+ logentry = LogEntry(change_message='non-JSON string')
+ self.assertEqual(logentry.get_change_message(), logentry.change_message)
+
@override_settings(USE_L10N=True)
def test_logentry_change_message_localized_datetime_input(self):
"""
@@ -177,6 +182,10 @@ class LogEntryTests(TestCase):
log_entry.action_flag = 4
self.assertEqual(str(log_entry), 'LogEntry Object')
+ def test_logentry_repr(self):
+ logentry = LogEntry.objects.first()
+ self.assertEqual(repr(logentry), str(logentry.action_time))
+
def test_log_action(self):
content_type_pk = ContentType.objects.get_for_model(Article).pk
log_entry = LogEntry.objects.log_action(