def _get_request_with_user(self, user):
        request = HttpRequest()
        request.META = {
            'SERVER_NAME': 'testserver',
            'SERVER_PORT': 80,
        }
        request.method = 'GET'
        request.session = {}

        # Add user
        request.user = user
        return request
Fake a request with an user
dataset/ETHPy150Open clione/django-kanban/src/core/userena/tests/middleware.py/UserenaLocaleMiddlewareTests._get_request_with_user