'Helper function to get useful module at self.location in self.course_id for user'

def get_module_for_user(self, user, item=None):

    mock_request = MagicMock()
    mock_request.user = user
    field_data_cache = FieldDataCache.cache_for_descriptor_descendents(self.course.id, user, self.course, depth=2)
    if (item is None):
        item = self.lti
    return render.get_module(user, mock_request, item.location, field_data_cache)._xmodule
