'Perform request from factory
:param method: Request method as string
:returns: Request instance
Several additional keywords arguments can be passed in:
user
User instance to use for the request, will default to an
:py:class:`AnonymousUser` instance otherwise.
session
Dictionary to instantiate the session handler with.
Other keyword arguments are passed into the request method'

def request(self, *args, **kwargs):

    factory = RequestFactory()
    method = kwargs.pop('method', 'get')
    fn = getattr(factory, method)
    request = fn(*args, **kwargs)
    request.user = kwargs.pop('user', AnonymousUser())
    session = kwargs.pop('session', {})
    middleware = SessionMiddleware()
    middleware.process_request(request)
    request.session.update(session)
    request.session.save()
    messages = FallbackStorage(request)
    setattr(request, '_messages', messages)
    return request
