'Creates a basic request for SSL use.'

@contextmanager
def _create_ssl_request(self, url):

    request = self.factory.get(url)
    request.META['SSL_CLIENT_S_DN'] = self.AUTH_DN.format(self.USER_NAME, self.USER_EMAIL)
    request.site = SiteFactory.create()
    request.user = AnonymousUser()
    middleware = SessionMiddleware()
    middleware.process_request(request)
    request.session.save()
    with patch('edxmako.request_context.get_current_request', return_value=request):
        (yield request)
