mirror of
https://github.com/django/django.git
synced 2025-08-04 02:48:35 +00:00
Fixed #27218 -- Returned LogEntry instances from ModelAdmin.log_*() methods.
This commit is contained in:
parent
e262f00231
commit
aa9569fce1
4 changed files with 22 additions and 4 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue