summaryrefslogtreecommitdiff
path: root/tests/admin_utils
diff options
context:
space:
mode:
authorFrançois Freitag <francois.freitag@polyconseil.fr>2016-09-30 14:55:51 -0700
committerTim Graham <timograham@gmail.com>2016-10-04 14:08:53 -0400
commitaa9569fce1b308819039450e3d2b852c37128209 (patch)
treed03c94d59da9857264d776607770750d7024a812 /tests/admin_utils
parente262f002311735869a5d8b0a8f788708322db595 (diff)
Fixed #27218 -- Returned LogEntry instances from ModelAdmin.log_*() methods.
Diffstat (limited to 'tests/admin_utils')
-rw-r--r--tests/admin_utils/test_logentry.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/tests/admin_utils/test_logentry.py b/tests/admin_utils/test_logentry.py
index 4ea182e2aa..aaa67ffc13 100644
--- a/tests/admin_utils/test_logentry.py
+++ b/tests/admin_utils/test_logentry.py
@@ -179,6 +179,14 @@ class LogEntryTests(TestCase):
log_entry.action_flag = 4
self.assertEqual(six.text_type(log_entry), 'LogEntry Object')
+ def test_log_action(self):
+ content_type_pk = ContentType.objects.get_for_model(Article).pk
+ log_entry = LogEntry.objects.log_action(
+ self.user.pk, content_type_pk, self.a1.pk, repr(self.a1), CHANGE,
+ change_message='Changed something else',
+ )
+ self.assertEqual(log_entry, LogEntry.objects.latest('action_time'))
+
def test_recentactions_without_content_type(self):
"""
If a LogEntry is missing content_type it will not display it in span