'Initialize a test request.'

def initialize_mock_request(self, request):

    request.user = self.user
    (request.site, __) = Site.objects.get_or_create(domain='test', name='test')
    request.session = {}
    MessageMiddleware().process_request(request)
