def test_request_anonymous(self):
        # Create a request
        request = self.factory.get('/')
        request.user = AnonymousUser()

        # Run middleware
        self.middleware.process_request(request)

        # Validate result
        self.assertFalse(pre_save.has_listeners(LogEntry))

        # Finalize transaction
        self.middleware.process_exception(request, None)
No actor will be logged when a user is not logged in.
dataset/ETHPy150Open jjkester/django-auditlog/src/auditlog_tests/tests.py/MiddlewareTest.test_request_anonymous