mirror of
https://github.com/django/django.git
synced 2025-10-24 06:06:09 +00:00
Fixed #27218 -- Returned LogEntry instances from ModelAdmin.log_*() methods.
This commit is contained in:
committed by
Tim Graham
parent
e262f00231
commit
aa9569fce1
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user