def build_launch_request(authenticated=True):
 request = RequestFactory().post('/')
 request.user = UserFactory.create()
 request.user.is_authenticated = MagicMock(return_value=authenticated)
 request.session = {}
 request.POST.update(LTI_DEFAULT_PARAMS)
 return request

def build_launch_request ( authenticated = True ) : request = RequestFactory ( ) . post ( '/' ) request . user = UserFactory . create ( ) request . user . is_authenticated = MagicMock ( return_value = authenticated ) request . session = { } request . POST . update ( LTI_DEFAULT_PARAMS ) return request
helper method to create a new request object for the lti launch .