def masquerade_as_group_member(user, course, partition_id, group_id):
 request = _create_mock_json_request(user, data={'role': 'student', 'user_partition_id': partition_id, 'group_id': group_id})
 response = handle_ajax(request, unicode(course.id))
 setup_masquerade(request, course.id, True)
 return response.status_code

def masquerade_as_group_member ( user , course , partition_id , group_id ) : request = _create_mock_json_request ( user , data = { 'role' : 'student' , 'user_partition_id' : partition_id , 'group_id' : group_id } ) response = handle_ajax ( request , unicode ( course . id ) ) setup_masquerade ( request , course . id , True ) return response . status_code
installs a masquerade for the specified user and course .