diff --git a/auditlog_tests/tests.py b/auditlog_tests/tests.py index ee267cc..69c2a4b 100644 --- a/auditlog_tests/tests.py +++ b/auditlog_tests/tests.py @@ -44,17 +44,12 @@ class SimpleModelTest(TestCase): # Check for log entries self.assertEqual(obj.history.count(), 1, msg="There is one log entry") - try: - history = obj.history.get() - except obj.history.DoesNotExist: - self.assertTrue(False, "Log entry exists") - else: - self.assertEqual( - history.action, LogEntry.Action.CREATE, msg="Action is 'CREATE'" - ) - self.assertEqual( - history.object_repr, str(obj), msg="Representation is equal" - ) + history = obj.history.get() + + self.assertEqual( + history.action, LogEntry.Action.CREATE, msg="Action is 'CREATE'" + ) + self.assertEqual(history.object_repr, str(obj), msg="Representation is equal") def test_update(self): """Updates are logged correctly."""