From e5f5e8ac17161708b18ac1e88aeedaa1fd7451ec Mon Sep 17 00:00:00 2001 From: Tim Graham Date: Wed, 5 Oct 2016 09:17:26 -0400 Subject: [PATCH] Refs #27218 -- Fixed LogEntry tests on MySQL 5.5. --- tests/admin_utils/test_logentry.py | 2 +- tests/modeladmin/tests.py | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/admin_utils/test_logentry.py b/tests/admin_utils/test_logentry.py index aaa67ffc13..ba0e3c1bfd 100644 --- a/tests/admin_utils/test_logentry.py +++ b/tests/admin_utils/test_logentry.py @@ -185,7 +185,7 @@ class LogEntryTests(TestCase): 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')) + self.assertEqual(log_entry, LogEntry.objects.latest('id')) def test_recentactions_without_content_type(self): """ diff --git a/tests/modeladmin/tests.py b/tests/modeladmin/tests.py index c9cde5a2c9..c2250b923b 100644 --- a/tests/modeladmin/tests.py +++ b/tests/modeladmin/tests.py @@ -539,9 +539,9 @@ class ModelAdminTests(TestCase): ma = ModelAdmin(Band, self.site) mock_request = MockRequest() mock_request.user = User.objects.create(username='bill') - self.assertEqual(ma.log_addition(mock_request, self.band, 'added'), LogEntry.objects.latest('action_time')) - self.assertEqual(ma.log_change(mock_request, self.band, 'changed'), LogEntry.objects.latest('action_time')) - self.assertEqual(ma.log_change(mock_request, self.band, 'deleted'), LogEntry.objects.latest('action_time')) + self.assertEqual(ma.log_addition(mock_request, self.band, 'added'), LogEntry.objects.latest('id')) + self.assertEqual(ma.log_change(mock_request, self.band, 'changed'), LogEntry.objects.latest('id')) + self.assertEqual(ma.log_change(mock_request, self.band, 'deleted'), LogEntry.objects.latest('id')) class CheckTestCase(SimpleTestCase):